View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   //  Generated by Modello Velocity from model-v3.vm
3   //  template, any modifications will be overwritten.
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.stream.Collectors;
15  import java.util.stream.Stream;
16  import org.apache.maven.api.annotations.Generated;
17  import org.apache.maven.api.annotations.Nonnull;
18  import org.codehaus.plexus.util.xml.Xpp3Dom;
19  
20  @Generated
21  public class ConfigurationContainer
22      extends BaseObject
23  {
24  
25      public ConfigurationContainer()
26      {
27          this( org.apache.maven.api.model.ConfigurationContainer.newInstance() );
28      }
29  
30      public ConfigurationContainer( org.apache.maven.api.model.ConfigurationContainer delegate )
31      {
32          this( delegate, null );
33      }
34  
35      public ConfigurationContainer( org.apache.maven.api.model.ConfigurationContainer delegate, BaseObject parent )
36      {
37          super( delegate, parent );
38      }
39  
40      public ConfigurationContainer clone()
41      {
42          return new ConfigurationContainer( getDelegate() );
43      }
44  
45      public org.apache.maven.api.model.ConfigurationContainer getDelegate()
46      {
47          return ( org.apache.maven.api.model.ConfigurationContainer ) super.getDelegate();
48      }
49  
50      @Override
51      public boolean equals( Object o )
52      {
53          if ( this == o )
54          {
55              return true;
56          }
57          if ( o == null || !( o instanceof ConfigurationContainer ) )
58          {
59              return false;
60          }
61          ConfigurationContainer that = ( ConfigurationContainer ) o;
62          return Objects.equals( this.delegate, that.delegate );
63      }
64  
65      @Override
66      public int hashCode()
67      {
68          return getDelegate().hashCode();
69      }
70  
71      public String getInherited()
72      {
73          return getDelegate().getInherited();
74      }
75  
76      public void setInherited( String inherited )
77      {
78          if ( !Objects.equals( inherited, getDelegate().getInherited() ) )
79          {
80              update( getDelegate().withInherited( inherited ) );
81          }
82      }
83  
84      public Object getConfiguration()
85      {
86          return getDelegate().getConfiguration() != null ? new Xpp3Dom( getDelegate().getConfiguration(), this::replace ) : null;
87      }
88  
89      public void setConfiguration( Object configuration )
90      {
91          if ( ! Objects.equals( ( ( Xpp3Dom ) configuration ).getDom(), getDelegate().getConfiguration() ) )
92          {
93              update( getDelegate().withConfiguration( ( ( Xpp3Dom ) configuration ).getDom() ) );
94              ( ( Xpp3Dom ) configuration ).setChildrenTracking( this::replace );
95          }
96      }
97  
98      public InputLocation getLocation( Object key )
99      {
100         org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation( key );
101         return loc != null ? new InputLocation( loc ) : null;
102     }
103 
104     public void setLocation( Object key, InputLocation location )
105     {
106         update( org.apache.maven.api.model.ConfigurationContainer.newBuilder( getDelegate(), true )
107                         .location( key, location.toApiLocation() ).build() );
108     }
109 
110     protected boolean replace( Object oldDelegate, Object newDelegate )
111     {
112         if ( super.replace( oldDelegate, newDelegate ) )
113         {
114             return true;
115         }
116         if ( getDelegate().getConfiguration() == oldDelegate )
117         {
118             update( getDelegate().withConfiguration( ( org.apache.maven.api.xml.XmlNode ) newDelegate ) );
119         }
120         return false;
121     }
122 
123     public static List<org.apache.maven.api.model.ConfigurationContainer> configurationContainerToApiV4( List<ConfigurationContainer> list )
124     {
125         return list != null ? new WrapperList<>( list, ConfigurationContainer::getDelegate, ConfigurationContainer::new ) : null;
126     }
127 
128     public static List<ConfigurationContainer> configurationContainerToApiV3( List<org.apache.maven.api.model.ConfigurationContainer> list )
129     {
130         return list != null ? new WrapperList<>( list, ConfigurationContainer::new, ConfigurationContainer::getDelegate ) : null;
131     }
132 
133 
134             
135     public boolean isInherited()
136     {
137         return ( getInherited() != null ) ? Boolean.parseBoolean( getInherited() ) : true;
138     }
139 
140             
141           
142 }