View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.11,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * Description of a person who has contributed to the project, but
10   * who does not have
11   *         commit privileges. Usually, these contributions come in
12   * the form of patches submitted.
13   * 
14   * @version $Revision$ $Date$
15   */
16  @SuppressWarnings( "all" )
17  public class Contributor
18      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
19  {
20  
21        //--------------------------/
22       //- Class/Member Variables -/
23      //--------------------------/
24  
25      /**
26       * The full name of the contributor.
27       */
28      private String name;
29  
30      /**
31       * The email address of the contributor.
32       */
33      private String email;
34  
35      /**
36       * The URL for the homepage of the contributor.
37       */
38      private String url;
39  
40      /**
41       * The organization to which the contributor belongs.
42       */
43      private String organization;
44  
45      /**
46       * The URL of the organization.
47       */
48      private String organizationUrl;
49  
50      /**
51       * Field roles.
52       */
53      private java.util.List<String> roles;
54  
55      /**
56       * 
57       *             
58       *               The timezone the contributor is in. Typically,
59       * this is a number in the range
60       *               <a
61       * href="http://en.wikipedia.org/wiki/UTC%E2%88%9212:00">-12</a>
62       * to <a
63       * href="http://en.wikipedia.org/wiki/UTC%2B14:00">+14</a>
64       *               or a valid time zone id like
65       * "America/Montreal" (UTC-05:00) or "Europe/Paris"
66       * (UTC+01:00).
67       *             
68       *           
69       */
70      private String timezone;
71  
72      /**
73       * Field properties.
74       */
75      private java.util.Properties properties;
76  
77      /**
78       * Field locations.
79       */
80      private java.util.Map<Object, InputLocation> locations;
81  
82      /**
83       * Field location.
84       */
85      private InputLocation location;
86  
87      /**
88       * Field nameLocation.
89       */
90      private InputLocation nameLocation;
91  
92      /**
93       * Field emailLocation.
94       */
95      private InputLocation emailLocation;
96  
97      /**
98       * Field urlLocation.
99       */
100     private InputLocation urlLocation;
101 
102     /**
103      * Field organizationLocation.
104      */
105     private InputLocation organizationLocation;
106 
107     /**
108      * Field organizationUrlLocation.
109      */
110     private InputLocation organizationUrlLocation;
111 
112     /**
113      * Field rolesLocation.
114      */
115     private InputLocation rolesLocation;
116 
117     /**
118      * Field timezoneLocation.
119      */
120     private InputLocation timezoneLocation;
121 
122     /**
123      * Field propertiesLocation.
124      */
125     private InputLocation propertiesLocation;
126 
127 
128       //-----------/
129      //- Methods -/
130     //-----------/
131 
132     /**
133      * Method addProperty.
134      * 
135      * @param key
136      * @param value
137      */
138     public void addProperty( String key, String value )
139     {
140         getProperties().put( key, value );
141     } //-- void addProperty( String, String )
142 
143     /**
144      * Method addRole.
145      * 
146      * @param string
147      */
148     public void addRole( String string )
149     {
150         getRoles().add( string );
151     } //-- void addRole( String )
152 
153     /**
154      * Method clone.
155      * 
156      * @return Contributor
157      */
158     public Contributor clone()
159     {
160         try
161         {
162             Contributor copy = (Contributor) super.clone();
163 
164             if ( this.roles != null )
165             {
166                 copy.roles = new java.util.ArrayList<String>();
167                 copy.roles.addAll( this.roles );
168             }
169 
170             if ( this.properties != null )
171             {
172                 copy.properties = (java.util.Properties) this.properties.clone();
173             }
174 
175             if ( copy.locations != null )
176             {
177                 copy.locations = new java.util.LinkedHashMap( copy.locations );
178             }
179 
180             return copy;
181         }
182         catch ( java.lang.Exception ex )
183         {
184             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
185                 + " does not support clone()" ).initCause( ex );
186         }
187     } //-- Contributor clone()
188 
189     /**
190      * Get the email address of the contributor.
191      * 
192      * @return String
193      */
194     public String getEmail()
195     {
196         return this.email;
197     } //-- String getEmail()
198 
199     /**
200      * 
201      * 
202      * @param key
203      * @return InputLocation
204      */
205     public InputLocation getLocation( Object key )
206     {
207         if ( key instanceof String )
208         {
209             switch ( ( String ) key )
210             {
211                 case "" :
212                 {
213                     return this.location;
214                 }
215                 case "name" :
216                 {
217                     return nameLocation;
218                 }
219                 case "email" :
220                 {
221                     return emailLocation;
222                 }
223                 case "url" :
224                 {
225                     return urlLocation;
226                 }
227                 case "organization" :
228                 {
229                     return organizationLocation;
230                 }
231                 case "organizationUrl" :
232                 {
233                     return organizationUrlLocation;
234                 }
235                 case "roles" :
236                 {
237                     return rolesLocation;
238                 }
239                 case "timezone" :
240                 {
241                     return timezoneLocation;
242                 }
243                 case "properties" :
244                 {
245                     return propertiesLocation;
246                 }
247                 default :
248                 {
249                     return getOtherLocation( key );
250                 }
251                 }
252             }
253             else
254             {
255                 return getOtherLocation( key );
256             }
257     } //-- InputLocation getLocation( Object )
258 
259     /**
260      * Get the full name of the contributor.
261      * 
262      * @return String
263      */
264     public String getName()
265     {
266         return this.name;
267     } //-- String getName()
268 
269     /**
270      * Get the organization to which the contributor belongs.
271      * 
272      * @return String
273      */
274     public String getOrganization()
275     {
276         return this.organization;
277     } //-- String getOrganization()
278 
279     /**
280      * Get the URL of the organization.
281      * 
282      * @return String
283      */
284     public String getOrganizationUrl()
285     {
286         return this.organizationUrl;
287     } //-- String getOrganizationUrl()
288 
289     /**
290      * 
291      * 
292      * @param key
293      * @param location
294      */
295     public void setLocation( Object key, InputLocation location )
296     {
297         if ( key instanceof String )
298         {
299             switch ( ( String ) key )
300             {
301                 case "" :
302                 {
303                     this.location = location;
304                     return;
305                 }
306                 case "name" :
307                 {
308                     nameLocation = location;
309                     return;
310                 }
311                 case "email" :
312                 {
313                     emailLocation = location;
314                     return;
315                 }
316                 case "url" :
317                 {
318                     urlLocation = location;
319                     return;
320                 }
321                 case "organization" :
322                 {
323                     organizationLocation = location;
324                     return;
325                 }
326                 case "organizationUrl" :
327                 {
328                     organizationUrlLocation = location;
329                     return;
330                 }
331                 case "roles" :
332                 {
333                     rolesLocation = location;
334                     return;
335                 }
336                 case "timezone" :
337                 {
338                     timezoneLocation = location;
339                     return;
340                 }
341                 case "properties" :
342                 {
343                     propertiesLocation = location;
344                     return;
345                 }
346                 default :
347                 {
348                     setOtherLocation( key, location );
349                     return;
350                 }
351                 }
352             }
353             else
354             {
355                 setOtherLocation( key, location );
356             }
357     } //-- void setLocation( Object, InputLocation )
358 
359     /**
360      * 
361      * 
362      * @param key
363      * @param location
364      */
365     public void setOtherLocation( Object key, InputLocation location )
366     {
367         if ( location != null )
368         {
369             if ( this.locations == null )
370             {
371                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
372             }
373             this.locations.put( key, location );
374         }
375     } //-- void setOtherLocation( Object, InputLocation )
376 
377     /**
378      * 
379      * 
380      * @param key
381      * @return InputLocation
382      */
383     private InputLocation getOtherLocation( Object key )
384     {
385         return ( locations != null ) ? locations.get( key ) : null;
386     } //-- InputLocation getOtherLocation( Object )
387 
388     /**
389      * Method getProperties.
390      * 
391      * @return Properties
392      */
393     public java.util.Properties getProperties()
394     {
395         if ( this.properties == null )
396         {
397             this.properties = new java.util.Properties();
398         }
399 
400         return this.properties;
401     } //-- java.util.Properties getProperties()
402 
403     /**
404      * Method getRoles.
405      * 
406      * @return List
407      */
408     public java.util.List<String> getRoles()
409     {
410         if ( this.roles == null )
411         {
412             this.roles = new java.util.ArrayList<String>();
413         }
414 
415         return this.roles;
416     } //-- java.util.List<String> getRoles()
417 
418     /**
419      * Get the timezone the contributor is in. Typically, this is a
420      * number in the range
421      *               <a
422      * href="http://en.wikipedia.org/wiki/UTC%E2%88%9212:00">-12</a>
423      * to <a
424      * href="http://en.wikipedia.org/wiki/UTC%2B14:00">+14</a>
425      *               or a valid time zone id like
426      * "America/Montreal" (UTC-05:00) or "Europe/Paris"
427      * (UTC+01:00).
428      * 
429      * @return String
430      */
431     public String getTimezone()
432     {
433         return this.timezone;
434     } //-- String getTimezone()
435 
436     /**
437      * Get the URL for the homepage of the contributor.
438      * 
439      * @return String
440      */
441     public String getUrl()
442     {
443         return this.url;
444     } //-- String getUrl()
445 
446     /**
447      * Method removeRole.
448      * 
449      * @param string
450      */
451     public void removeRole( String string )
452     {
453         getRoles().remove( string );
454     } //-- void removeRole( String )
455 
456     /**
457      * Set the email address of the contributor.
458      * 
459      * @param email
460      */
461     public void setEmail( String email )
462     {
463         this.email = email;
464     } //-- void setEmail( String )
465 
466     /**
467      * Set the full name of the contributor.
468      * 
469      * @param name
470      */
471     public void setName( String name )
472     {
473         this.name = name;
474     } //-- void setName( String )
475 
476     /**
477      * Set the organization to which the contributor belongs.
478      * 
479      * @param organization
480      */
481     public void setOrganization( String organization )
482     {
483         this.organization = organization;
484     } //-- void setOrganization( String )
485 
486     /**
487      * Set the URL of the organization.
488      * 
489      * @param organizationUrl
490      */
491     public void setOrganizationUrl( String organizationUrl )
492     {
493         this.organizationUrl = organizationUrl;
494     } //-- void setOrganizationUrl( String )
495 
496     /**
497      * Set properties about the contributor, such as an instant
498      * messenger handle.
499      * 
500      * @param properties
501      */
502     public void setProperties( java.util.Properties properties )
503     {
504         this.properties = properties;
505     } //-- void setProperties( java.util.Properties )
506 
507     /**
508      * Set the roles the contributor plays in the project. Each
509      * role is described by a
510      *             <code>role</code> element, the body of which is
511      * a role name. This can also be used to
512      *             describe the contribution.
513      * 
514      * @param roles
515      */
516     public void setRoles( java.util.List<String> roles )
517     {
518         this.roles = roles;
519     } //-- void setRoles( java.util.List )
520 
521     /**
522      * Set the timezone the contributor is in. Typically, this is a
523      * number in the range
524      *               <a
525      * href="http://en.wikipedia.org/wiki/UTC%E2%88%9212:00">-12</a>
526      * to <a
527      * href="http://en.wikipedia.org/wiki/UTC%2B14:00">+14</a>
528      *               or a valid time zone id like
529      * "America/Montreal" (UTC-05:00) or "Europe/Paris"
530      * (UTC+01:00).
531      * 
532      * @param timezone
533      */
534     public void setTimezone( String timezone )
535     {
536         this.timezone = timezone;
537     } //-- void setTimezone( String )
538 
539     /**
540      * Set the URL for the homepage of the contributor.
541      * 
542      * @param url
543      */
544     public void setUrl( String url )
545     {
546         this.url = url;
547     } //-- void setUrl( String )
548 
549     
550             
551     /**
552      * @see java.lang.Object#toString()
553      */
554     public String toString()
555     {
556         return "Contributor {name=" + name + ", email=" + email + "}";
557     }
558             
559           
560 }