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  import org.codehaus.plexus.util.xml.Xpp3Dom;
19  
20  @Generated
21  public class Extension
22      extends BaseObject
23  {
24  
25      public Extension() {
26          this(org.apache.maven.api.model.Extension.newInstance());
27      }
28  
29      public Extension(org.apache.maven.api.model.Extension delegate) {
30          this(delegate, null);
31      }
32  
33      public Extension(org.apache.maven.api.model.Extension delegate, BaseObject parent) {
34          super(delegate, parent);
35      }
36  
37      public Extension clone(){
38          return new Extension(getDelegate());
39      }
40  
41      public org.apache.maven.api.model.Extension getDelegate() {
42          return (org.apache.maven.api.model.Extension) 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 Extension)) {
51              return false;
52          }
53          Extension that = (Extension) 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 InputLocation getLocation(Object key) {
93          org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
94          return loc != null ? new InputLocation(loc) : null;
95      }
96  
97      public void setLocation(Object key, InputLocation location) {
98          update(org.apache.maven.api.model.Extension.newBuilder(getDelegate(), true)
99                          .location(key, location.toApiLocation()).build());
100     }
101 
102     protected boolean replace(Object oldDelegate, Object newDelegate) {
103         if (super.replace(oldDelegate, newDelegate)) {
104             return true;
105         }
106         return false;
107     }
108 
109     public static List<org.apache.maven.api.model.Extension> extensionToApiV4(List<Extension> list) {
110         return list != null ? new WrapperList<>(list, Extension::getDelegate, Extension::new) : null;
111     }
112 
113     public static List<Extension> extensionToApiV3(List<org.apache.maven.api.model.Extension> list) {
114         return list != null ? new WrapperList<>(list, Extension::new, Extension::getDelegate) : null;
115     }
116 
117 }