1
2
3
4
5 package org.apache.maven.model;
6
7 import java.io.Serializable;
8 import java.util.AbstractList;
9 import java.util.Collections;
10 import java.util.HashMap;
11 import java.util.List;
12 import java.util.Map;
13 import java.util.Objects;
14 import java.util.Set;
15 import java.util.stream.Collectors;
16 import java.util.stream.Stream;
17 import org.apache.maven.api.annotations.Generated;
18 import org.apache.maven.api.annotations.Nonnull;
19 import org.codehaus.plexus.util.xml.Xpp3Dom;
20
21 @Generated
22 public class ConfigurationContainer
23 extends BaseObject
24 {
25
26 public ConfigurationContainer() {
27 this(org.apache.maven.api.model.ConfigurationContainer.newInstance());
28 }
29
30 public ConfigurationContainer(org.apache.maven.api.model.ConfigurationContainer delegate) {
31 this(delegate, null);
32 }
33
34 public ConfigurationContainer(org.apache.maven.api.model.ConfigurationContainer delegate, BaseObject parent) {
35 super(delegate, parent);
36 }
37
38 public ConfigurationContainer clone(){
39 return new ConfigurationContainer(getDelegate());
40 }
41
42 public org.apache.maven.api.model.ConfigurationContainer getDelegate() {
43 return (org.apache.maven.api.model.ConfigurationContainer) super.getDelegate();
44 }
45
46 @Override
47 public boolean equals(Object o) {
48 if (this == o) {
49 return true;
50 }
51 if (o == null || !(o instanceof ConfigurationContainer)) {
52 return false;
53 }
54 ConfigurationContainer that = (ConfigurationContainer) o;
55 return Objects.equals(this.delegate, that.delegate);
56 }
57
58 @Override
59 public int hashCode() {
60 return getDelegate().hashCode();
61 }
62
63 public String getInherited() {
64 return getDelegate().getInherited();
65 }
66
67 public void setInherited(String inherited) {
68 if (!Objects.equals(inherited, getInherited())) {
69 update(getDelegate().withInherited(inherited));
70 }
71 }
72
73 public Object getConfiguration() {
74 return getDelegate().getConfiguration() != null ? new Xpp3Dom(getDelegate().getConfiguration(), this::replace) : null;
75 }
76
77 public void setConfiguration(Object configuration) {
78 if (configuration instanceof Xpp3Dom) {
79 if (!Objects.equals(((Xpp3Dom) configuration).getDom(), getDelegate().getConfiguration())) {
80 update(getDelegate().withConfiguration(((Xpp3Dom) configuration).getDom()));
81 ((Xpp3Dom) configuration).setChildrenTracking(this::replace);
82 }
83 } else if (configuration == null) {
84 if (getDelegate().getConfiguration() != null) {
85 update(getDelegate().withConfiguration(null));
86 }
87 } else {
88 throw new IllegalArgumentException("Expected an Xpp3Dom object but received a " + configuration.getClass() + ": " + configuration);
89 }
90 }
91
92 public InputLocation getLocation(Object key) {
93 org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
94 return loc != null ? new InputLocation(loc) : null;
95 }
96
97 public void setLocation(Object key, InputLocation location) {
98 update(org.apache.maven.api.model.ConfigurationContainer.newBuilder(getDelegate(), true)
99 .location(key, location.toApiLocation()).build());
100 }
101
102 public InputLocation getImportedFrom() {
103 org.apache.maven.api.model.InputLocation loc = getDelegate().getImportedFrom();
104 return loc != null ? new InputLocation(loc) : null;
105 }
106
107 public void setImportedFrom(InputLocation location) {
108 update(org.apache.maven.api.model.ConfigurationContainer.newBuilder(getDelegate(), true)
109 .importedFrom(location.toApiLocation()).build());
110 }
111
112 public Set<Object> getLocationKeys() {
113 return getDelegate().getLocationKeys();
114 }
115
116 protected boolean replace(Object oldDelegate, Object newDelegate) {
117 if (super.replace(oldDelegate, newDelegate)) {
118 return true;
119 }
120 if (getDelegate().getConfiguration() == oldDelegate) {
121 update(getDelegate().withConfiguration((org.apache.maven.api.xml.XmlNode) newDelegate));
122 }
123 return false;
124 }
125
126 public static List<org.apache.maven.api.model.ConfigurationContainer> configurationContainerToApiV4(List<ConfigurationContainer> list) {
127 return list != null ? new WrapperList<>(list, ConfigurationContainer::getDelegate, ConfigurationContainer::new) : null;
128 }
129
130 public static List<ConfigurationContainer> configurationContainerToApiV3(List<org.apache.maven.api.model.ConfigurationContainer> list) {
131 return list != null ? new WrapperList<>(list, ConfigurationContainer::new, ConfigurationContainer::getDelegate) : null;
132 }
133
134
135
136 public boolean isInherited() {
137 return ( getInherited() != null ) ? Boolean.parseBoolean( getInherited() ) : true;
138 }
139
140
141
142
143
144 @Deprecated
145 public void unsetInheritanceApplied() {
146 }
147
148
149
150 }