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  
19  @Generated
20  public class Parent
21      extends BaseObject
22  {
23  
24      public Parent()
25      {
26          this( org.apache.maven.api.model.Parent.newInstance() );
27      }
28  
29      public Parent( org.apache.maven.api.model.Parent delegate )
30      {
31          this( delegate, null );
32      }
33  
34      public Parent( org.apache.maven.api.model.Parent delegate, BaseObject parent )
35      {
36          super( delegate, parent );
37      }
38  
39      public Parent clone()
40      {
41          return new Parent( getDelegate() );
42      }
43  
44      public org.apache.maven.api.model.Parent getDelegate()
45      {
46          return ( org.apache.maven.api.model.Parent ) super.getDelegate();
47      }
48  
49      @Override
50      public boolean equals( Object o )
51      {
52          if ( this == o )
53          {
54              return true;
55          }
56          if ( o == null || !( o instanceof Parent ) )
57          {
58              return false;
59          }
60          Parent that = ( Parent ) o;
61          return Objects.equals( this.delegate, that.delegate );
62      }
63  
64      @Override
65      public int hashCode()
66      {
67          return getDelegate().hashCode();
68      }
69  
70      public String getGroupId()
71      {
72          return getDelegate().getGroupId();
73      }
74  
75      public void setGroupId( String groupId )
76      {
77          if ( !Objects.equals( groupId, getDelegate().getGroupId() ) )
78          {
79              update( getDelegate().withGroupId( groupId ) );
80          }
81      }
82  
83      public String getArtifactId()
84      {
85          return getDelegate().getArtifactId();
86      }
87  
88      public void setArtifactId( String artifactId )
89      {
90          if ( !Objects.equals( artifactId, getDelegate().getArtifactId() ) )
91          {
92              update( getDelegate().withArtifactId( artifactId ) );
93          }
94      }
95  
96      public String getVersion()
97      {
98          return getDelegate().getVersion();
99      }
100 
101     public void setVersion( String version )
102     {
103         if ( !Objects.equals( version, getDelegate().getVersion() ) )
104         {
105             update( getDelegate().withVersion( version ) );
106         }
107     }
108 
109     public String getRelativePath()
110     {
111         return getDelegate().getRelativePath();
112     }
113 
114     public void setRelativePath( String relativePath )
115     {
116         if ( !Objects.equals( relativePath, getDelegate().getRelativePath() ) )
117         {
118             update( getDelegate().withRelativePath( relativePath ) );
119         }
120     }
121 
122     public InputLocation getLocation( Object key )
123     {
124         org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation( key );
125         return loc != null ? new InputLocation( loc ) : null;
126     }
127 
128     public void setLocation( Object key, InputLocation location )
129     {
130         update( org.apache.maven.api.model.Parent.newBuilder( getDelegate(), true )
131                         .location( key, location.toApiLocation() ).build() );
132     }
133 
134     protected boolean replace( Object oldDelegate, Object newDelegate )
135     {
136         if ( super.replace( oldDelegate, newDelegate ) )
137         {
138             return true;
139         }
140         return false;
141     }
142 
143     public static List<org.apache.maven.api.model.Parent> parentToApiV4( List<Parent> list )
144     {
145         return list != null ? new WrapperList<>( list, Parent::getDelegate, Parent::new ) : null;
146     }
147 
148     public static List<Parent> parentToApiV3( List<org.apache.maven.api.model.Parent> list )
149     {
150         return list != null ? new WrapperList<>( list, Parent::new, Parent::getDelegate ) : null;
151     }
152 
153 
154             
155     /**
156      * @return the id as {@code groupId:artifactId:version}
157      */
158     public String getId()
159     {
160         StringBuilder id = new StringBuilder( 64 );
161 
162         id.append( getGroupId() );
163         id.append( ":" );
164         id.append( getArtifactId() );
165         id.append( ":" );
166         id.append( "pom" );
167         id.append( ":" );
168         id.append( getVersion() );
169 
170         return id.toString();
171     }
172 
173     @Override
174     public String toString()
175     {
176         return getId();
177     }
178             
179           
180 }