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