View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   //   Generated by Maven, any modifications will be overwritten.
3   // ==============================================================
4   package org.apache.maven.model;
5   
6   import java.io.Serializable;
7   import java.util.AbstractList;
8   import java.util.Collections;
9   import java.util.HashMap;
10  import java.util.List;
11  import java.util.Map;
12  import java.util.Objects;
13  import java.util.stream.Collectors;
14  import java.util.stream.Stream;
15  import org.apache.maven.api.annotations.Generated;
16  import org.apache.maven.api.annotations.Nonnull;
17  import org.codehaus.plexus.util.xml.Xpp3Dom;
18  
19  @Generated
20  public class ConfigurationContainer
21      extends BaseObject
22  {
23  
24      public ConfigurationContainer()
25      {
26          this( org.apache.maven.api.model.ConfigurationContainer.newInstance() );
27      }
28  
29      public ConfigurationContainer( org.apache.maven.api.model.ConfigurationContainer delegate )
30      {
31          this( delegate, null );
32      }
33  
34      public ConfigurationContainer( org.apache.maven.api.model.ConfigurationContainer delegate, BaseObject parent )
35      {
36          super( delegate, parent );
37      }
38  
39      public ConfigurationContainer clone()
40      {
41          return new ConfigurationContainer( getDelegate() );
42      }
43  
44      public org.apache.maven.api.model.ConfigurationContainer getDelegate()
45      {
46          return ( org.apache.maven.api.model.ConfigurationContainer ) super.getDelegate();
47      }
48  
49      public String getInherited()
50      {
51          return getDelegate().getInherited();
52      }
53  
54      public void setInherited( String inherited )
55      {
56          if ( !Objects.equals( inherited, getDelegate().getInherited() ) )
57          {
58              update( getDelegate().withInherited( inherited ) );
59          }
60      }
61  
62      public Object getConfiguration()
63      {
64          return getDelegate().getConfiguration() != null ? new Xpp3Dom( getDelegate().getConfiguration(), this::replace ) : null;
65      }
66  
67      public void setConfiguration( Object configuration )
68      {
69          if ( ! Objects.equals( ( ( Xpp3Dom ) configuration ).getDom(), getDelegate().getConfiguration() ) )
70          {
71              update( getDelegate().withConfiguration( ( ( Xpp3Dom ) configuration ).getDom() ) );
72              ( ( Xpp3Dom ) configuration ).setChildrenTracking( this::replace );
73          }
74      }
75  
76      public InputLocation getLocation( Object key )
77      {
78          org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation( key );
79          return loc != null ? new InputLocation( loc ) : null;
80      }
81  
82      public void setLocation( Object key, InputLocation location )
83      {
84          update( org.apache.maven.api.model.ConfigurationContainer.newBuilder( getDelegate(), true )
85                          .location( key, location.toApiLocation() ).build() );
86      }
87  
88      protected boolean replace( Object oldDelegate, Object newDelegate )
89      {
90          if ( super.replace( oldDelegate, newDelegate ) )
91          {
92              return true;
93          }
94          if ( getDelegate().getConfiguration() == oldDelegate )
95          {
96              update( getDelegate().withConfiguration( ( org.apache.maven.api.xml.Dom ) newDelegate ) );
97          }
98          return false;
99      }
100 
101     public static List<org.apache.maven.api.model.ConfigurationContainer> configurationContainerToApiV4( List<ConfigurationContainer> list )
102     {
103         return list != null ? new WrapperList<>( list, ConfigurationContainer::getDelegate, ConfigurationContainer::new ) : null;
104     }
105 
106     public static List<ConfigurationContainer> configurationContainerToApiV3( List<org.apache.maven.api.model.ConfigurationContainer> list )
107     {
108         return list != null ? new WrapperList<>( list, ConfigurationContainer::new, ConfigurationContainer::getDelegate ) : null;
109     }
110 
111 
112             
113     public boolean isInherited()
114     {
115         return ( getInherited() != null ) ? Boolean.parseBoolean( getInherited() ) : true;
116     }
117 
118             
119           
120 }