1
2
3
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 import org.codehaus.plexus.util.xml.Xpp3Dom;
20
21 @Generated
22 public class Extension
23 extends BaseObject
24 {
25
26 public Extension() {
27 this(org.apache.maven.api.model.Extension.newInstance());
28 }
29
30 public Extension(org.apache.maven.api.model.Extension delegate) {
31 this(delegate, null);
32 }
33
34 public Extension(org.apache.maven.api.model.Extension delegate, BaseObject parent) {
35 super(delegate, parent);
36 }
37
38 public Extension clone(){
39 return new Extension(getDelegate());
40 }
41
42 public org.apache.maven.api.model.Extension getDelegate() {
43 return (org.apache.maven.api.model.Extension) super.getDelegate();
44 }
45
46 @Override
47 public boolean equals(Object o) {
48 if (this == o) {
49 return true;
50 }
51 if (o == null || !(o instanceof Extension)) {
52 return false;
53 }
54 Extension that = (Extension) o;
55 return Objects.equals(this.delegate, that.delegate);
56 }
57
58 @Override
59 public int hashCode() {
60 return getDelegate().hashCode();
61 }
62
63 public String getGroupId() {
64 return getDelegate().getGroupId();
65 }
66
67 public void setGroupId(String groupId) {
68 if (!Objects.equals(groupId, getGroupId())) {
69 update(getDelegate().withGroupId(groupId));
70 }
71 }
72
73 public String getArtifactId() {
74 return getDelegate().getArtifactId();
75 }
76
77 public void setArtifactId(String artifactId) {
78 if (!Objects.equals(artifactId, getArtifactId())) {
79 update(getDelegate().withArtifactId(artifactId));
80 }
81 }
82
83 public String getVersion() {
84 return getDelegate().getVersion();
85 }
86
87 public void setVersion(String version) {
88 if (!Objects.equals(version, getVersion())) {
89 update(getDelegate().withVersion(version));
90 }
91 }
92
93 public InputLocation getLocation(Object key) {
94 org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
95 return loc != null ? new InputLocation(loc) : null;
96 }
97
98 public void setLocation(Object key, InputLocation location) {
99 update(org.apache.maven.api.model.Extension.newBuilder(getDelegate(), true)
100 .location(key, location.toApiLocation()).build());
101 }
102
103 public InputLocation getImportedFrom() {
104 org.apache.maven.api.model.InputLocation loc = getDelegate().getImportedFrom();
105 return loc != null ? new InputLocation(loc) : null;
106 }
107
108 public void setImportedFrom(InputLocation location) {
109 update(org.apache.maven.api.model.Extension.newBuilder(getDelegate(), true)
110 .importedFrom(location.toApiLocation()).build());
111 }
112
113 public Set<Object> getLocationKeys() {
114 return getDelegate().getLocationKeys();
115 }
116
117 protected boolean replace(Object oldDelegate, Object newDelegate) {
118 if (super.replace(oldDelegate, newDelegate)) {
119 return true;
120 }
121 return false;
122 }
123
124 public static List<org.apache.maven.api.model.Extension> extensionToApiV4(List<Extension> list) {
125 return list != null ? new WrapperList<>(list, Extension::getDelegate, Extension::new) : null;
126 }
127
128 public static List<Extension> extensionToApiV3(List<org.apache.maven.api.model.Extension> list) {
129 return list != null ? new WrapperList<>(list, Extension::new, Extension::getDelegate) : null;
130 }
131
132 }