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.ArrayList;
10 import java.util.Collections;
11 import java.util.HashMap;
12 import java.util.List;
13 import java.util.Map;
14 import java.util.Objects;
15 import java.util.Set;
16 import java.util.stream.Collectors;
17 import java.util.stream.Stream;
18 import org.apache.maven.api.annotations.Generated;
19 import org.apache.maven.api.annotations.Nonnull;
20
21 @Generated
22 public class MailingList
23 extends BaseObject
24 {
25
26 public MailingList() {
27 this(org.apache.maven.api.model.MailingList.newInstance());
28 }
29
30 public MailingList(org.apache.maven.api.model.MailingList delegate) {
31 this(delegate, null);
32 }
33
34 public MailingList(org.apache.maven.api.model.MailingList delegate, BaseObject parent) {
35 super(delegate, parent);
36 }
37
38 public MailingList clone(){
39 return new MailingList(getDelegate());
40 }
41
42 public org.apache.maven.api.model.MailingList getDelegate() {
43 return (org.apache.maven.api.model.MailingList) 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 MailingList)) {
52 return false;
53 }
54 MailingList that = (MailingList) 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 getName() {
64 return getDelegate().getName();
65 }
66
67 public void setName(String name) {
68 if (!Objects.equals(name, getName())) {
69 update(getDelegate().withName(name));
70 }
71 }
72
73 public String getSubscribe() {
74 return getDelegate().getSubscribe();
75 }
76
77 public void setSubscribe(String subscribe) {
78 if (!Objects.equals(subscribe, getSubscribe())) {
79 update(getDelegate().withSubscribe(subscribe));
80 }
81 }
82
83 public String getUnsubscribe() {
84 return getDelegate().getUnsubscribe();
85 }
86
87 public void setUnsubscribe(String unsubscribe) {
88 if (!Objects.equals(unsubscribe, getUnsubscribe())) {
89 update(getDelegate().withUnsubscribe(unsubscribe));
90 }
91 }
92
93 public String getPost() {
94 return getDelegate().getPost();
95 }
96
97 public void setPost(String post) {
98 if (!Objects.equals(post, getPost())) {
99 update(getDelegate().withPost(post));
100 }
101 }
102
103 public String getArchive() {
104 return getDelegate().getArchive();
105 }
106
107 public void setArchive(String archive) {
108 if (!Objects.equals(archive, getArchive())) {
109 update(getDelegate().withArchive(archive));
110 }
111 }
112
113 @Nonnull
114 public List<String> getOtherArchives() {
115 return new WrapperList<String, String>(() -> getDelegate().getOtherArchives(), this::setOtherArchives, s -> s, s -> s);
116 }
117
118 public void setOtherArchives(List<String> otherArchives) {
119 if (!Objects.equals(otherArchives, getOtherArchives())) {
120 update(getDelegate().withOtherArchives(otherArchives));
121 }
122 }
123
124 public void addOtherArchive(String otherArchive) {
125 update(getDelegate().withOtherArchives(
126 Stream.concat(getDelegate().getOtherArchives().stream(), Stream.of(otherArchive))
127 .collect(Collectors.toList())));
128 }
129
130 public void removeOtherArchive(String otherArchive) {
131 update(getDelegate().withOtherArchives(
132 getDelegate().getOtherArchives().stream()
133 .filter(e -> !Objects.equals(e, otherArchive))
134 .collect(Collectors.toList())));
135 }
136
137 public InputLocation getLocation(Object key) {
138 org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
139 return loc != null ? new InputLocation(loc) : null;
140 }
141
142 public void setLocation(Object key, InputLocation location) {
143 update(org.apache.maven.api.model.MailingList.newBuilder(getDelegate(), true)
144 .location(key, location.toApiLocation()).build());
145 }
146
147 public InputLocation getImportedFrom() {
148 org.apache.maven.api.model.InputLocation loc = getDelegate().getImportedFrom();
149 return loc != null ? new InputLocation(loc) : null;
150 }
151
152 public void setImportedFrom(InputLocation location) {
153 update(org.apache.maven.api.model.MailingList.newBuilder(getDelegate(), true)
154 .importedFrom(location.toApiLocation()).build());
155 }
156
157 public Set<Object> getLocationKeys() {
158 return getDelegate().getLocationKeys();
159 }
160
161 protected boolean replace(Object oldDelegate, Object newDelegate) {
162 if (super.replace(oldDelegate, newDelegate)) {
163 return true;
164 }
165 return false;
166 }
167
168 public static List<org.apache.maven.api.model.MailingList> mailingListToApiV4(List<MailingList> list) {
169 return list != null ? new WrapperList<>(list, MailingList::getDelegate, MailingList::new) : null;
170 }
171
172 public static List<MailingList> mailingListToApiV3(List<org.apache.maven.api.model.MailingList> list) {
173 return list != null ? new WrapperList<>(list, MailingList::new, MailingList::getDelegate) : null;
174 }
175
176
177
178
179
180
181 public String toString()
182 {
183 return "MailingList {name=" + getName() + ", archive=" + getArchive() + "}";
184 }
185
186
187 }