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