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