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.ArrayList;
10  import java.util.Collections;
11  import java.util.HashMap;
12  import java.util.List;
13  import java.util.Map;
14  import java.util.Objects;
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  
20  @Generated
21  public class PluginConfiguration
22      extends PluginContainer
23      implements Serializable, Cloneable
24  {
25  
26      public PluginConfiguration()
27      {
28          this( org.apache.maven.api.model.PluginConfiguration.newInstance() );
29      }
30  
31      public PluginConfiguration( org.apache.maven.api.model.PluginConfiguration delegate )
32      {
33          this( delegate, null );
34      }
35  
36      public PluginConfiguration( org.apache.maven.api.model.PluginConfiguration delegate, BaseObject parent )
37      {
38          super( delegate, parent );
39      }
40  
41      public PluginConfiguration clone()
42      {
43          return new PluginConfiguration( getDelegate() );
44      }
45  
46      @Override
47      public org.apache.maven.api.model.PluginConfiguration getDelegate()
48      {
49          return ( org.apache.maven.api.model.PluginConfiguration ) super.getDelegate();
50      }
51  
52      @Override
53      public boolean equals( Object o )
54      {
55          if ( this == o )
56          {
57              return true;
58          }
59          if ( o == null || !( o instanceof PluginConfiguration ) )
60          {
61              return false;
62          }
63          PluginConfiguration that = ( PluginConfiguration ) o;
64          return Objects.equals( this.delegate, that.delegate );
65      }
66  
67      @Override
68      public int hashCode()
69      {
70          return getDelegate().hashCode();
71      }
72  
73      public PluginManagement getPluginManagement()
74      {
75          return getDelegate().getPluginManagement() != null ? new PluginManagement( getDelegate().getPluginManagement(), this ) : null;
76      }
77  
78      public void setPluginManagement( PluginManagement pluginManagement )
79      {
80          if ( !Objects.equals( pluginManagement, getDelegate().getPluginManagement() ) )
81          {
82              update( getDelegate().withPluginManagement( pluginManagement.getDelegate() ) );
83              pluginManagement.childrenTracking = this::replace;
84          }
85      }
86  
87      public InputLocation getLocation( Object key )
88      {
89          org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation( key );
90          return loc != null ? new InputLocation( loc ) : null;
91      }
92  
93      public void setLocation( Object key, InputLocation location )
94      {
95          update( org.apache.maven.api.model.PluginConfiguration.newBuilder( getDelegate(), true )
96                          .location( key, location.toApiLocation() ).build() );
97      }
98  
99      protected boolean replace( Object oldDelegate, Object newDelegate )
100     {
101         if ( super.replace( oldDelegate, newDelegate ) )
102         {
103             return true;
104         }
105         if ( oldDelegate == getDelegate().getPluginManagement() )
106         {
107             update( getDelegate().withPluginManagement( ( org.apache.maven.api.model.PluginManagement ) newDelegate ) );
108             return true;
109         }
110         return false;
111     }
112 
113     public static List<org.apache.maven.api.model.PluginConfiguration> pluginConfigurationToApiV4( List<PluginConfiguration> list )
114     {
115         return list != null ? new WrapperList<>( list, PluginConfiguration::getDelegate, PluginConfiguration::new ) : null;
116     }
117 
118     public static List<PluginConfiguration> pluginConfigurationToApiV3( List<org.apache.maven.api.model.PluginConfiguration> list )
119     {
120         return list != null ? new WrapperList<>( list, PluginConfiguration::new, PluginConfiguration::getDelegate ) : null;
121     }
122 
123 
124             
125     /**
126      * @see java.lang.Object#toString()
127      */
128     public String toString()
129     {
130         return "PluginConfiguration {" + super.toString() + "}";
131     }
132             
133           
134 }