1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.apache.maven.model;
25
26
27
28
29
30
31
32
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
41
42
43
44
45
46 private String name;
47
48
49
50
51 private String email;
52
53
54
55
56 private String url;
57
58
59
60
61 private String organization;
62
63
64
65
66 private String organizationUrl;
67
68
69
70
71 private java.util.List<String> roles;
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 private String timezone;
89
90
91
92
93 private java.util.Properties properties;
94
95
96
97
98 private java.util.Map<Object, InputLocation> locations;
99
100
101
102
103 private InputLocation location;
104
105
106
107
108 private InputLocation nameLocation;
109
110
111
112
113 private InputLocation emailLocation;
114
115
116
117
118 private InputLocation urlLocation;
119
120
121
122
123 private InputLocation organizationLocation;
124
125
126
127
128 private InputLocation organizationUrlLocation;
129
130
131
132
133 private InputLocation rolesLocation;
134
135
136
137
138 private InputLocation timezoneLocation;
139
140
141
142
143 private InputLocation propertiesLocation;
144
145
146
147
148
149
150
151
152
153
154
155
156 public void addProperty( String key, String value )
157 {
158 getProperties().put( key, value );
159 }
160
161
162
163
164
165
166 public void addRole( String string )
167 {
168 getRoles().add( string );
169 }
170
171
172
173
174
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 }
206
207
208
209
210
211
212 public String getEmail()
213 {
214 return this.email;
215 }
216
217
218
219
220
221
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 }
276
277
278
279
280
281
282 public String getName()
283 {
284 return this.name;
285 }
286
287
288
289
290
291
292 public String getOrganization()
293 {
294 return this.organization;
295 }
296
297
298
299
300
301
302 public String getOrganizationUrl()
303 {
304 return this.organizationUrl;
305 }
306
307
308
309
310
311
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 }
376
377
378
379
380
381
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 }
394
395
396
397
398
399
400
401 private InputLocation getOtherLocation( Object key )
402 {
403 return ( locations != null ) ? locations.get( key ) : null;
404 }
405
406
407
408
409
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 }
420
421
422
423
424
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 }
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449 public String getTimezone()
450 {
451 return this.timezone;
452 }
453
454
455
456
457
458
459 public String getUrl()
460 {
461 return this.url;
462 }
463
464
465
466
467
468
469 public void removeRole( String string )
470 {
471 getRoles().remove( string );
472 }
473
474
475
476
477
478
479 public void setEmail( String email )
480 {
481 this.email = email;
482 }
483
484
485
486
487
488
489 public void setName( String name )
490 {
491 this.name = name;
492 }
493
494
495
496
497
498
499 public void setOrganization( String organization )
500 {
501 this.organization = organization;
502 }
503
504
505
506
507
508
509 public void setOrganizationUrl( String organizationUrl )
510 {
511 this.organizationUrl = organizationUrl;
512 }
513
514
515
516
517
518
519
520 public void setProperties( java.util.Properties properties )
521 {
522 this.properties = properties;
523 }
524
525
526
527
528
529
530
531
532
533
534 public void setRoles( java.util.List<String> roles )
535 {
536 this.roles = roles;
537 }
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552 public void setTimezone( String timezone )
553 {
554 this.timezone = timezone;
555 }
556
557
558
559
560
561
562 public void setUrl( String url )
563 {
564 this.url = url;
565 }
566
567
568
569
570
571
572 public String toString()
573 {
574 return "Contributor {name=" + name + ", email=" + email + "}";
575 }
576
577
578 }