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