View Javadoc
1   /*
2    Licensed to the Apache Software Foundation (ASF) under one
3    or more contributor license agreements.  See the NOTICE file
4    distributed with this work for additional information
5    regarding copyright ownership.  The ASF licenses this file
6    to you under the Apache License, Version 2.0 (the
7    "License"); you may not use this file except in compliance
8    with the License.  You may obtain a copy of the License at
9    
10       http://www.apache.org/licenses/LICENSE-2.0
11   
12   Unless required by applicable law or agreed to in writing,
13   software distributed under the License is distributed on an
14   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   KIND, either express or implied.  See the License for the
16   specific language governing permissions and limitations
17   under the License.
18   =================== DO NOT EDIT THIS FILE ====================
19   Generated by Modello 2.4.0,
20   any modifications will be overwritten.
21   ==============================================================
22   */
23  
24  package org.apache.maven.model;
25  
26  /**
27   * This element describes all of the mailing lists associated with
28   * a project. The
29   *         auto-generated site references this information.
30   * 
31   * @version $Revision$ $Date$
32   */
33  @SuppressWarnings( "all" )
34  public class MailingList
35      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
36  {
37  
38        //--------------------------/
39       //- Class/Member Variables -/
40      //--------------------------/
41  
42      /**
43       * 
44       *             
45       *             The name of the mailing list.
46       *             
47       *           
48       */
49      private String name;
50  
51      /**
52       * 
53       *             
54       *             The email address or link that can be used to
55       * subscribe to
56       *             the mailing list.  If this is an email address,
57       * a
58       *             <code>mailto:</code> link will automatically be
59       * created
60       *             when the documentation is created.
61       *             
62       *           
63       */
64      private String subscribe;
65  
66      /**
67       * 
68       *             
69       *             The email address or link that can be used to
70       * unsubscribe to
71       *             the mailing list.  If this is an email address,
72       * a
73       *             <code>mailto:</code> link will automatically be
74       * created
75       *             when the documentation is created.
76       *             
77       *           
78       */
79      private String unsubscribe;
80  
81      /**
82       * 
83       *             
84       *             The email address or link that can be used to
85       * post to
86       *             the mailing list.  If this is an email address,
87       * a
88       *             <code>mailto:</code> link will automatically be
89       * created
90       *             when the documentation is created.
91       *             
92       *           
93       */
94      private String post;
95  
96      /**
97       * The link to a URL where you can browse the mailing list
98       * archive.
99       */
100     private String archive;
101 
102     /**
103      * Field otherArchives.
104      */
105     private java.util.List<String> otherArchives;
106 
107     /**
108      * Field locations.
109      */
110     private java.util.Map<Object, InputLocation> locations;
111 
112     /**
113      * Field location.
114      */
115     private InputLocation location;
116 
117     /**
118      * Field nameLocation.
119      */
120     private InputLocation nameLocation;
121 
122     /**
123      * Field subscribeLocation.
124      */
125     private InputLocation subscribeLocation;
126 
127     /**
128      * Field unsubscribeLocation.
129      */
130     private InputLocation unsubscribeLocation;
131 
132     /**
133      * Field postLocation.
134      */
135     private InputLocation postLocation;
136 
137     /**
138      * Field archiveLocation.
139      */
140     private InputLocation archiveLocation;
141 
142     /**
143      * Field otherArchivesLocation.
144      */
145     private InputLocation otherArchivesLocation;
146 
147 
148       //-----------/
149      //- Methods -/
150     //-----------/
151 
152     /**
153      * Method addOtherArchive.
154      * 
155      * @param string a string object.
156      */
157     public void addOtherArchive( String string )
158     {
159         getOtherArchives().add( string );
160     } //-- void addOtherArchive( String )
161 
162     /**
163      * Method clone.
164      * 
165      * @return MailingList
166      */
167     public MailingList clone()
168     {
169         try
170         {
171             MailingList copy = (MailingList) super.clone();
172 
173             if ( this.otherArchives != null )
174             {
175                 copy.otherArchives = new java.util.ArrayList<String>();
176                 copy.otherArchives.addAll( this.otherArchives );
177             }
178 
179             if ( copy.locations != null )
180             {
181                 copy.locations = new java.util.LinkedHashMap( copy.locations );
182             }
183 
184             return copy;
185         }
186         catch ( java.lang.Exception ex )
187         {
188             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
189                 + " does not support clone()" ).initCause( ex );
190         }
191     } //-- MailingList clone()
192 
193     /**
194      * Get the link to a URL where you can browse the mailing list
195      * archive.
196      * 
197      * @return String
198      */
199     public String getArchive()
200     {
201         return this.archive;
202     } //-- String getArchive()
203 
204     /**
205      * 
206      * 
207      * @param key a key object.
208      * @return InputLocation
209      */
210     public InputLocation getLocation( Object key )
211     {
212         if ( key instanceof String )
213         {
214             switch ( ( String ) key )
215             {
216                 case "" :
217                 {
218                     return this.location;
219                 }
220                 case "name" :
221                 {
222                     return nameLocation;
223                 }
224                 case "subscribe" :
225                 {
226                     return subscribeLocation;
227                 }
228                 case "unsubscribe" :
229                 {
230                     return unsubscribeLocation;
231                 }
232                 case "post" :
233                 {
234                     return postLocation;
235                 }
236                 case "archive" :
237                 {
238                     return archiveLocation;
239                 }
240                 case "otherArchives" :
241                 {
242                     return otherArchivesLocation;
243                 }
244                 default :
245                 {
246                     return getOtherLocation( key );
247                 }
248                 }
249             }
250             else
251             {
252                 return getOtherLocation( key );
253             }
254     } //-- InputLocation getLocation( Object )
255 
256     /**
257      * Get the name of the mailing list.
258      * 
259      * @return String
260      */
261     public String getName()
262     {
263         return this.name;
264     } //-- String getName()
265 
266     /**
267      * Method getOtherArchives.
268      * 
269      * @return List
270      */
271     public java.util.List<String> getOtherArchives()
272     {
273         if ( this.otherArchives == null )
274         {
275             this.otherArchives = new java.util.ArrayList<String>();
276         }
277 
278         return this.otherArchives;
279     } //-- java.util.List<String> getOtherArchives()
280 
281     /**
282      * 
283      * 
284      * @param key a key object.
285      * @param location a location object.
286      */
287     public void setLocation( Object key, InputLocation location )
288     {
289         if ( key instanceof String )
290         {
291             switch ( ( String ) key )
292             {
293                 case "" :
294                 {
295                     this.location = location;
296                     return;
297                 }
298                 case "name" :
299                 {
300                     nameLocation = location;
301                     return;
302                 }
303                 case "subscribe" :
304                 {
305                     subscribeLocation = location;
306                     return;
307                 }
308                 case "unsubscribe" :
309                 {
310                     unsubscribeLocation = location;
311                     return;
312                 }
313                 case "post" :
314                 {
315                     postLocation = location;
316                     return;
317                 }
318                 case "archive" :
319                 {
320                     archiveLocation = location;
321                     return;
322                 }
323                 case "otherArchives" :
324                 {
325                     otherArchivesLocation = location;
326                     return;
327                 }
328                 default :
329                 {
330                     setOtherLocation( key, location );
331                     return;
332                 }
333             }
334         }
335         else
336         {
337             setOtherLocation( key, location );
338         }
339     } //-- void setLocation( Object, InputLocation )
340 
341     /**
342      * 
343      * 
344      * @param key a key object.
345      * @param location a location object.
346      */
347     public void setOtherLocation( Object key, InputLocation location )
348     {
349         if ( location != null )
350         {
351             if ( this.locations == null )
352             {
353                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
354             }
355             this.locations.put( key, location );
356         }
357     } //-- void setOtherLocation( Object, InputLocation )
358 
359     /**
360      * 
361      * 
362      * @param key a key object.
363      * @return InputLocation
364      */
365     private InputLocation getOtherLocation( Object key )
366     {
367         return ( locations != null ) ? locations.get( key ) : null;
368     } //-- InputLocation getOtherLocation( Object )
369 
370     /**
371      * Get the email address or link that can be used to post to
372      *             the mailing list.  If this is an email address,
373      * a
374      *             <code>mailto:</code> link will automatically be
375      * created
376      *             when the documentation is created.
377      * 
378      * @return String
379      */
380     public String getPost()
381     {
382         return this.post;
383     } //-- String getPost()
384 
385     /**
386      * Get the email address or link that can be used to subscribe
387      * to
388      *             the mailing list.  If this is an email address,
389      * a
390      *             <code>mailto:</code> link will automatically be
391      * created
392      *             when the documentation is created.
393      * 
394      * @return String
395      */
396     public String getSubscribe()
397     {
398         return this.subscribe;
399     } //-- String getSubscribe()
400 
401     /**
402      * Get the email address or link that can be used to
403      * unsubscribe to
404      *             the mailing list.  If this is an email address,
405      * a
406      *             <code>mailto:</code> link will automatically be
407      * created
408      *             when the documentation is created.
409      * 
410      * @return String
411      */
412     public String getUnsubscribe()
413     {
414         return this.unsubscribe;
415     } //-- String getUnsubscribe()
416 
417     /**
418      * Method removeOtherArchive.
419      * 
420      * @param string a string object.
421      */
422     public void removeOtherArchive( String string )
423     {
424         getOtherArchives().remove( string );
425     } //-- void removeOtherArchive( String )
426 
427     /**
428      * Set the link to a URL where you can browse the mailing list
429      * archive.
430      * 
431      * @param archive a archive object.
432      */
433     public void setArchive( String archive )
434     {
435         this.archive = archive;
436     } //-- void setArchive( String )
437 
438     /**
439      * Set the name of the mailing list.
440      * 
441      * @param name a name object.
442      */
443     public void setName( String name )
444     {
445         this.name = name;
446     } //-- void setName( String )
447 
448     /**
449      * Set the link to alternate URLs where you can browse the list
450      * archive.
451      * 
452      * @param otherArchives a otherArchives object.
453      */
454     public void setOtherArchives( java.util.List<String> otherArchives )
455     {
456         this.otherArchives = otherArchives;
457     } //-- void setOtherArchives( java.util.List )
458 
459     /**
460      * Set the email address or link that can be used to post to
461      *             the mailing list.  If this is an email address,
462      * a
463      *             <code>mailto:</code> link will automatically be
464      * created
465      *             when the documentation is created.
466      * 
467      * @param post a post object.
468      */
469     public void setPost( String post )
470     {
471         this.post = post;
472     } //-- void setPost( String )
473 
474     /**
475      * Set the email address or link that can be used to subscribe
476      * to
477      *             the mailing list.  If this is an email address,
478      * a
479      *             <code>mailto:</code> link will automatically be
480      * created
481      *             when the documentation is created.
482      * 
483      * @param subscribe a subscribe object.
484      */
485     public void setSubscribe( String subscribe )
486     {
487         this.subscribe = subscribe;
488     } //-- void setSubscribe( String )
489 
490     /**
491      * Set the email address or link that can be used to
492      * unsubscribe to
493      *             the mailing list.  If this is an email address,
494      * a
495      *             <code>mailto:</code> link will automatically be
496      * created
497      *             when the documentation is created.
498      * 
499      * @param unsubscribe a unsubscribe object.
500      */
501     public void setUnsubscribe( String unsubscribe )
502     {
503         this.unsubscribe = unsubscribe;
504     } //-- void setUnsubscribe( String )
505 
506     
507             
508     /**
509      * @see java.lang.Object#toString()
510      */
511     public String toString()
512     {
513         return "MailingList {name=" + name + ", archive=" + archive + "}";
514     }
515             
516           
517 }