1
2
3
4
5
6 package org.apache.maven.model;
7
8
9
10
11
12
13
14
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
23
24
25
26
27
28 private String name;
29
30
31
32
33 private String email;
34
35
36
37
38 private String url;
39
40
41
42
43 private String organization;
44
45
46
47
48 private String organizationUrl;
49
50
51
52
53 private java.util.List<String> roles;
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70 private String timezone;
71
72
73
74
75 private java.util.Properties properties;
76
77
78
79
80 private java.util.Map<Object, InputLocation> locations;
81
82
83
84
85 private InputLocation location;
86
87
88
89
90 private InputLocation nameLocation;
91
92
93
94
95 private InputLocation emailLocation;
96
97
98
99
100 private InputLocation urlLocation;
101
102
103
104
105 private InputLocation organizationLocation;
106
107
108
109
110 private InputLocation organizationUrlLocation;
111
112
113
114
115 private InputLocation rolesLocation;
116
117
118
119
120 private InputLocation timezoneLocation;
121
122
123
124
125 private InputLocation propertiesLocation;
126
127
128
129
130
131
132
133
134
135
136
137
138 public void addProperty( String key, String value )
139 {
140 getProperties().put( key, value );
141 }
142
143
144
145
146
147
148 public void addRole( String string )
149 {
150 getRoles().add( string );
151 }
152
153
154
155
156
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 }
188
189
190
191
192
193
194 public String getEmail()
195 {
196 return this.email;
197 }
198
199
200
201
202
203
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 }
258
259
260
261
262
263
264 public String getName()
265 {
266 return this.name;
267 }
268
269
270
271
272
273
274 public String getOrganization()
275 {
276 return this.organization;
277 }
278
279
280
281
282
283
284 public String getOrganizationUrl()
285 {
286 return this.organizationUrl;
287 }
288
289
290
291
292
293
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 }
358
359
360
361
362
363
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 }
376
377
378
379
380
381
382
383 private InputLocation getOtherLocation( Object key )
384 {
385 return ( locations != null ) ? locations.get( key ) : null;
386 }
387
388
389
390
391
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 }
402
403
404
405
406
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 }
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431 public String getTimezone()
432 {
433 return this.timezone;
434 }
435
436
437
438
439
440
441 public String getUrl()
442 {
443 return this.url;
444 }
445
446
447
448
449
450
451 public void removeRole( String string )
452 {
453 getRoles().remove( string );
454 }
455
456
457
458
459
460
461 public void setEmail( String email )
462 {
463 this.email = email;
464 }
465
466
467
468
469
470
471 public void setName( String name )
472 {
473 this.name = name;
474 }
475
476
477
478
479
480
481 public void setOrganization( String organization )
482 {
483 this.organization = organization;
484 }
485
486
487
488
489
490
491 public void setOrganizationUrl( String organizationUrl )
492 {
493 this.organizationUrl = organizationUrl;
494 }
495
496
497
498
499
500
501
502 public void setProperties( java.util.Properties properties )
503 {
504 this.properties = properties;
505 }
506
507
508
509
510
511
512
513
514
515
516 public void setRoles( java.util.List<String> roles )
517 {
518 this.roles = roles;
519 }
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534 public void setTimezone( String timezone )
535 {
536 this.timezone = timezone;
537 }
538
539
540
541
542
543
544 public void setUrl( String url )
545 {
546 this.url = url;
547 }
548
549
550
551
552
553
554 public String toString()
555 {
556 return "Contributor {name=" + name + ", email=" + email + "}";
557 }
558
559
560 }