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.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 MailingList
22 extends BaseObject
23 {
24
25 public MailingList()
26 {
27 this( org.apache.maven.api.model.MailingList.newInstance() );
28 }
29
30 public MailingList( org.apache.maven.api.model.MailingList delegate )
31 {
32 this( delegate, null );
33 }
34
35 public MailingList( org.apache.maven.api.model.MailingList delegate, BaseObject parent )
36 {
37 super( delegate, parent );
38 }
39
40 public MailingList clone()
41 {
42 return new MailingList( getDelegate() );
43 }
44
45 public org.apache.maven.api.model.MailingList getDelegate()
46 {
47 return ( org.apache.maven.api.model.MailingList ) super.getDelegate();
48 }
49
50 @Override
51 public boolean equals( Object o )
52 {
53 if ( this == o )
54 {
55 return true;
56 }
57 if ( o == null || !( o instanceof MailingList ) )
58 {
59 return false;
60 }
61 MailingList that = ( MailingList ) o;
62 return Objects.equals( this.delegate, that.delegate );
63 }
64
65 @Override
66 public int hashCode()
67 {
68 return getDelegate().hashCode();
69 }
70
71 public String getName()
72 {
73 return getDelegate().getName();
74 }
75
76 public void setName( String name )
77 {
78 if ( !Objects.equals( name, getDelegate().getName() ) )
79 {
80 update( getDelegate().withName( name ) );
81 }
82 }
83
84 public String getSubscribe()
85 {
86 return getDelegate().getSubscribe();
87 }
88
89 public void setSubscribe( String subscribe )
90 {
91 if ( !Objects.equals( subscribe, getDelegate().getSubscribe() ) )
92 {
93 update( getDelegate().withSubscribe( subscribe ) );
94 }
95 }
96
97 public String getUnsubscribe()
98 {
99 return getDelegate().getUnsubscribe();
100 }
101
102 public void setUnsubscribe( String unsubscribe )
103 {
104 if ( !Objects.equals( unsubscribe, getDelegate().getUnsubscribe() ) )
105 {
106 update( getDelegate().withUnsubscribe( unsubscribe ) );
107 }
108 }
109
110 public String getPost()
111 {
112 return getDelegate().getPost();
113 }
114
115 public void setPost( String post )
116 {
117 if ( !Objects.equals( post, getDelegate().getPost() ) )
118 {
119 update( getDelegate().withPost( post ) );
120 }
121 }
122
123 public String getArchive()
124 {
125 return getDelegate().getArchive();
126 }
127
128 public void setArchive( String archive )
129 {
130 if ( !Objects.equals( archive, getDelegate().getArchive() ) )
131 {
132 update( getDelegate().withArchive( archive ) );
133 }
134 }
135
136 @Nonnull
137 public List<String> getOtherArchives()
138 {
139 return new WrapperList<String, String>( () -> getDelegate().getOtherArchives(), this::setOtherArchives, s -> s, s -> s );
140 }
141
142 public void setOtherArchives( List<String> otherArchives )
143 {
144 if ( !Objects.equals( otherArchives, getDelegate().getOtherArchives() ) )
145 {
146 update( getDelegate().withOtherArchives( otherArchives ) );
147 }
148 }
149
150 public void addOtherArchive( String otherArchive )
151 {
152 update( getDelegate().withOtherArchives(
153 Stream.concat( getDelegate().getOtherArchives().stream(), Stream.of( otherArchive ) )
154 .collect( Collectors.toList() ) ) );
155 }
156
157 public void removeOtherArchive( String otherArchive )
158 {
159 update( getDelegate().withOtherArchives(
160 getDelegate().getOtherArchives().stream()
161 .filter( e -> !Objects.equals( e, otherArchive ) )
162 .collect( Collectors.toList() ) ) );
163 }
164
165 public InputLocation getLocation( Object key )
166 {
167 org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation( key );
168 return loc != null ? new InputLocation( loc ) : null;
169 }
170
171 public void setLocation( Object key, InputLocation location )
172 {
173 update( org.apache.maven.api.model.MailingList.newBuilder( getDelegate(), true )
174 .location( key, location.toApiLocation() ).build() );
175 }
176
177 protected boolean replace( Object oldDelegate, Object newDelegate )
178 {
179 if ( super.replace( oldDelegate, newDelegate ) )
180 {
181 return true;
182 }
183 return false;
184 }
185
186 public static List<org.apache.maven.api.model.MailingList> mailingListToApiV4( List<MailingList> list )
187 {
188 return list != null ? new WrapperList<>( list, MailingList::getDelegate, MailingList::new ) : null;
189 }
190
191 public static List<MailingList> mailingListToApiV3( List<org.apache.maven.api.model.MailingList> list )
192 {
193 return list != null ? new WrapperList<>( list, MailingList::new, MailingList::getDelegate ) : null;
194 }
195
196
197
198
199
200
201 public String toString()
202 {
203 return "MailingList {name=" + getName() + ", archive=" + getArchive() + "}";
204 }
205
206
207 }