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