Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DocumentAuthor |
|
| 2.588235294117647;2,588 |
1 | /* | |
2 | =================== DO NOT EDIT THIS FILE ==================== | |
3 | Generated by Modello 1.4.1 on 2012-04-13 21:33:05, | |
4 | any modifications will be overwritten. | |
5 | ============================================================== | |
6 | */ | |
7 | ||
8 | package org.apache.maven.doxia.document; | |
9 | ||
10 | /** | |
11 | * An author of the document. | |
12 | * | |
13 | * @version $Revision$ $Date$ | |
14 | */ | |
15 | @SuppressWarnings( "all" ) | |
16 | 8 | public class DocumentAuthor |
17 | implements java.io.Serializable | |
18 | { | |
19 | ||
20 | //--------------------------/ | |
21 | //- Class/Member Variables -/ | |
22 | //--------------------------/ | |
23 | ||
24 | /** | |
25 | * | |
26 | * The first name of the author. | |
27 | * | |
28 | */ | |
29 | private String firstName; | |
30 | ||
31 | /** | |
32 | * | |
33 | * The last name of the author. | |
34 | * | |
35 | */ | |
36 | private String lastName; | |
37 | ||
38 | /** | |
39 | * | |
40 | * The full name of the author, usually as a String | |
41 | * of "firstName lastName". | |
42 | * @since 1.1.1 | |
43 | * . | |
44 | */ | |
45 | private String name; | |
46 | ||
47 | /** | |
48 | * | |
49 | * The initials of the author. | |
50 | * | |
51 | */ | |
52 | private String initials; | |
53 | ||
54 | /** | |
55 | * | |
56 | * The title of the author. | |
57 | * | |
58 | */ | |
59 | private String title; | |
60 | ||
61 | /** | |
62 | * | |
63 | * The position of the author. | |
64 | * | |
65 | */ | |
66 | private String position; | |
67 | ||
68 | /** | |
69 | * | |
70 | * The email address of the author. | |
71 | * | |
72 | */ | |
73 | private String email; | |
74 | ||
75 | /** | |
76 | * | |
77 | * The telephone number of the author. | |
78 | * | |
79 | */ | |
80 | private String phoneNumber; | |
81 | ||
82 | /** | |
83 | * | |
84 | * The fax number of the author. | |
85 | * | |
86 | */ | |
87 | private String faxNumber; | |
88 | ||
89 | /** | |
90 | * | |
91 | * The name of the company that employs the author. | |
92 | * | |
93 | */ | |
94 | private String companyName; | |
95 | ||
96 | /** | |
97 | * | |
98 | * The street name of the address of the author. | |
99 | * | |
100 | */ | |
101 | private String street; | |
102 | ||
103 | /** | |
104 | * | |
105 | * The city name of the address of the author. | |
106 | * | |
107 | */ | |
108 | private String city; | |
109 | ||
110 | /** | |
111 | * | |
112 | * The postal code of the address of the author. | |
113 | * | |
114 | */ | |
115 | private String postalCode; | |
116 | ||
117 | /** | |
118 | * | |
119 | * The country of the address of the author. | |
120 | * | |
121 | */ | |
122 | private String country; | |
123 | ||
124 | /** | |
125 | * | |
126 | * The state or province of the address of the | |
127 | * author, if applicable. | |
128 | * | |
129 | */ | |
130 | private String state; | |
131 | ||
132 | ||
133 | //-----------/ | |
134 | //- Methods -/ | |
135 | //-----------/ | |
136 | ||
137 | /** | |
138 | * Method equals. | |
139 | * | |
140 | * @param other | |
141 | * @return boolean | |
142 | */ | |
143 | public boolean equals( Object other ) | |
144 | { | |
145 | 4 | if ( this == other ) |
146 | { | |
147 | 0 | return true; |
148 | } | |
149 | ||
150 | 4 | if ( !( other instanceof DocumentAuthor ) ) |
151 | { | |
152 | 0 | return false; |
153 | } | |
154 | ||
155 | 4 | DocumentAuthor that = (DocumentAuthor) other; |
156 | 4 | boolean result = true; |
157 | ||
158 | 4 | result = result && ( getFirstName() == null ? that.getFirstName() == null : getFirstName().equals( that.getFirstName() ) ); |
159 | 4 | result = result && ( getLastName() == null ? that.getLastName() == null : getLastName().equals( that.getLastName() ) ); |
160 | 4 | result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) ); |
161 | 4 | result = result && ( getInitials() == null ? that.getInitials() == null : getInitials().equals( that.getInitials() ) ); |
162 | 4 | result = result && ( getTitle() == null ? that.getTitle() == null : getTitle().equals( that.getTitle() ) ); |
163 | 4 | result = result && ( getPosition() == null ? that.getPosition() == null : getPosition().equals( that.getPosition() ) ); |
164 | 4 | result = result && ( getEmail() == null ? that.getEmail() == null : getEmail().equals( that.getEmail() ) ); |
165 | 4 | result = result && ( getPhoneNumber() == null ? that.getPhoneNumber() == null : getPhoneNumber().equals( that.getPhoneNumber() ) ); |
166 | 4 | result = result && ( getFaxNumber() == null ? that.getFaxNumber() == null : getFaxNumber().equals( that.getFaxNumber() ) ); |
167 | 4 | result = result && ( getCompanyName() == null ? that.getCompanyName() == null : getCompanyName().equals( that.getCompanyName() ) ); |
168 | 4 | result = result && ( getStreet() == null ? that.getStreet() == null : getStreet().equals( that.getStreet() ) ); |
169 | 4 | result = result && ( getCity() == null ? that.getCity() == null : getCity().equals( that.getCity() ) ); |
170 | 4 | result = result && ( getPostalCode() == null ? that.getPostalCode() == null : getPostalCode().equals( that.getPostalCode() ) ); |
171 | 4 | result = result && ( getCountry() == null ? that.getCountry() == null : getCountry().equals( that.getCountry() ) ); |
172 | 4 | result = result && ( getState() == null ? that.getState() == null : getState().equals( that.getState() ) ); |
173 | ||
174 | 4 | return result; |
175 | } //-- boolean equals( Object ) | |
176 | ||
177 | /** | |
178 | * Get the city name of the address of the author. | |
179 | * | |
180 | * @return String | |
181 | */ | |
182 | public String getCity() | |
183 | { | |
184 | 36 | return this.city; |
185 | } //-- String getCity() | |
186 | ||
187 | /** | |
188 | * Get the name of the company that employs the author. | |
189 | * | |
190 | * @return String | |
191 | */ | |
192 | public String getCompanyName() | |
193 | { | |
194 | 36 | return this.companyName; |
195 | } //-- String getCompanyName() | |
196 | ||
197 | /** | |
198 | * Get the country of the address of the author. | |
199 | * | |
200 | * @return String | |
201 | */ | |
202 | public String getCountry() | |
203 | { | |
204 | 36 | return this.country; |
205 | } //-- String getCountry() | |
206 | ||
207 | /** | |
208 | * Get the email address of the author. | |
209 | * | |
210 | * @return String | |
211 | */ | |
212 | public String getEmail() | |
213 | { | |
214 | 36 | return this.email; |
215 | } //-- String getEmail() | |
216 | ||
217 | /** | |
218 | * Get the fax number of the author. | |
219 | * | |
220 | * @return String | |
221 | */ | |
222 | public String getFaxNumber() | |
223 | { | |
224 | 36 | return this.faxNumber; |
225 | } //-- String getFaxNumber() | |
226 | ||
227 | /** | |
228 | * Get the first name of the author. | |
229 | * | |
230 | * @return String | |
231 | */ | |
232 | public String getFirstName() | |
233 | { | |
234 | 36 | return this.firstName; |
235 | } //-- String getFirstName() | |
236 | ||
237 | /** | |
238 | * Get the initials of the author. | |
239 | * | |
240 | * @return String | |
241 | */ | |
242 | public String getInitials() | |
243 | { | |
244 | 36 | return this.initials; |
245 | } //-- String getInitials() | |
246 | ||
247 | /** | |
248 | * Get the last name of the author. | |
249 | * | |
250 | * @return String | |
251 | */ | |
252 | public String getLastName() | |
253 | { | |
254 | 36 | return this.lastName; |
255 | } //-- String getLastName() | |
256 | ||
257 | /** | |
258 | * Get the full name of the author, usually as a String of | |
259 | * "firstName lastName". | |
260 | * @since 1.1.1. | |
261 | * | |
262 | * @return String | |
263 | */ | |
264 | public String getName() | |
265 | { | |
266 | 36 | return this.name; |
267 | } //-- String getName() | |
268 | ||
269 | /** | |
270 | * Get the telephone number of the author. | |
271 | * | |
272 | * @return String | |
273 | */ | |
274 | public String getPhoneNumber() | |
275 | { | |
276 | 36 | return this.phoneNumber; |
277 | } //-- String getPhoneNumber() | |
278 | ||
279 | /** | |
280 | * Get the position of the author. | |
281 | * | |
282 | * @return String | |
283 | */ | |
284 | public String getPosition() | |
285 | { | |
286 | 36 | return this.position; |
287 | } //-- String getPosition() | |
288 | ||
289 | /** | |
290 | * Get the postal code of the address of the author. | |
291 | * | |
292 | * @return String | |
293 | */ | |
294 | public String getPostalCode() | |
295 | { | |
296 | 36 | return this.postalCode; |
297 | } //-- String getPostalCode() | |
298 | ||
299 | /** | |
300 | * Get the state or province of the address of the author, if | |
301 | * applicable. | |
302 | * | |
303 | * @return String | |
304 | */ | |
305 | public String getState() | |
306 | { | |
307 | 36 | return this.state; |
308 | } //-- String getState() | |
309 | ||
310 | /** | |
311 | * Get the street name of the address of the author. | |
312 | * | |
313 | * @return String | |
314 | */ | |
315 | public String getStreet() | |
316 | { | |
317 | 36 | return this.street; |
318 | } //-- String getStreet() | |
319 | ||
320 | /** | |
321 | * Get the title of the author. | |
322 | * | |
323 | * @return String | |
324 | */ | |
325 | public String getTitle() | |
326 | { | |
327 | 36 | return this.title; |
328 | } //-- String getTitle() | |
329 | ||
330 | /** | |
331 | * Method hashCode. | |
332 | * | |
333 | * @return int | |
334 | */ | |
335 | public int hashCode() | |
336 | { | |
337 | 8 | int result = 17; |
338 | ||
339 | 8 | result = 37 * result + ( firstName != null ? firstName.hashCode() : 0 ); |
340 | 8 | result = 37 * result + ( lastName != null ? lastName.hashCode() : 0 ); |
341 | 8 | result = 37 * result + ( name != null ? name.hashCode() : 0 ); |
342 | 8 | result = 37 * result + ( initials != null ? initials.hashCode() : 0 ); |
343 | 8 | result = 37 * result + ( title != null ? title.hashCode() : 0 ); |
344 | 8 | result = 37 * result + ( position != null ? position.hashCode() : 0 ); |
345 | 8 | result = 37 * result + ( email != null ? email.hashCode() : 0 ); |
346 | 8 | result = 37 * result + ( phoneNumber != null ? phoneNumber.hashCode() : 0 ); |
347 | 8 | result = 37 * result + ( faxNumber != null ? faxNumber.hashCode() : 0 ); |
348 | 8 | result = 37 * result + ( companyName != null ? companyName.hashCode() : 0 ); |
349 | 8 | result = 37 * result + ( street != null ? street.hashCode() : 0 ); |
350 | 8 | result = 37 * result + ( city != null ? city.hashCode() : 0 ); |
351 | 8 | result = 37 * result + ( postalCode != null ? postalCode.hashCode() : 0 ); |
352 | 8 | result = 37 * result + ( country != null ? country.hashCode() : 0 ); |
353 | 8 | result = 37 * result + ( state != null ? state.hashCode() : 0 ); |
354 | ||
355 | 8 | return result; |
356 | } //-- int hashCode() | |
357 | ||
358 | /** | |
359 | * Set the city name of the address of the author. | |
360 | * | |
361 | * @param city | |
362 | */ | |
363 | public void setCity( String city ) | |
364 | { | |
365 | 8 | this.city = city; |
366 | 8 | } //-- void setCity( String ) |
367 | ||
368 | /** | |
369 | * Set the name of the company that employs the author. | |
370 | * | |
371 | * @param companyName | |
372 | */ | |
373 | public void setCompanyName( String companyName ) | |
374 | { | |
375 | 8 | this.companyName = companyName; |
376 | 8 | } //-- void setCompanyName( String ) |
377 | ||
378 | /** | |
379 | * Set the country of the address of the author. | |
380 | * | |
381 | * @param country | |
382 | */ | |
383 | public void setCountry( String country ) | |
384 | { | |
385 | 8 | this.country = country; |
386 | 8 | } //-- void setCountry( String ) |
387 | ||
388 | /** | |
389 | * Set the email address of the author. | |
390 | * | |
391 | * @param email | |
392 | */ | |
393 | public void setEmail( String email ) | |
394 | { | |
395 | 8 | this.email = email; |
396 | 8 | } //-- void setEmail( String ) |
397 | ||
398 | /** | |
399 | * Set the fax number of the author. | |
400 | * | |
401 | * @param faxNumber | |
402 | */ | |
403 | public void setFaxNumber( String faxNumber ) | |
404 | { | |
405 | 8 | this.faxNumber = faxNumber; |
406 | 8 | } //-- void setFaxNumber( String ) |
407 | ||
408 | /** | |
409 | * Set the first name of the author. | |
410 | * | |
411 | * @param firstName | |
412 | */ | |
413 | public void setFirstName( String firstName ) | |
414 | { | |
415 | 8 | this.firstName = firstName; |
416 | 8 | } //-- void setFirstName( String ) |
417 | ||
418 | /** | |
419 | * Set the initials of the author. | |
420 | * | |
421 | * @param initials | |
422 | */ | |
423 | public void setInitials( String initials ) | |
424 | { | |
425 | 8 | this.initials = initials; |
426 | 8 | } //-- void setInitials( String ) |
427 | ||
428 | /** | |
429 | * Set the last name of the author. | |
430 | * | |
431 | * @param lastName | |
432 | */ | |
433 | public void setLastName( String lastName ) | |
434 | { | |
435 | 8 | this.lastName = lastName; |
436 | 8 | } //-- void setLastName( String ) |
437 | ||
438 | /** | |
439 | * Set the full name of the author, usually as a String of | |
440 | * "firstName lastName". | |
441 | * @since 1.1.1. | |
442 | * | |
443 | * @param name | |
444 | */ | |
445 | public void setName( String name ) | |
446 | { | |
447 | 8 | this.name = name; |
448 | 8 | } //-- void setName( String ) |
449 | ||
450 | /** | |
451 | * Set the telephone number of the author. | |
452 | * | |
453 | * @param phoneNumber | |
454 | */ | |
455 | public void setPhoneNumber( String phoneNumber ) | |
456 | { | |
457 | 8 | this.phoneNumber = phoneNumber; |
458 | 8 | } //-- void setPhoneNumber( String ) |
459 | ||
460 | /** | |
461 | * Set the position of the author. | |
462 | * | |
463 | * @param position | |
464 | */ | |
465 | public void setPosition( String position ) | |
466 | { | |
467 | 8 | this.position = position; |
468 | 8 | } //-- void setPosition( String ) |
469 | ||
470 | /** | |
471 | * Set the postal code of the address of the author. | |
472 | * | |
473 | * @param postalCode | |
474 | */ | |
475 | public void setPostalCode( String postalCode ) | |
476 | { | |
477 | 8 | this.postalCode = postalCode; |
478 | 8 | } //-- void setPostalCode( String ) |
479 | ||
480 | /** | |
481 | * Set the state or province of the address of the author, if | |
482 | * applicable. | |
483 | * | |
484 | * @param state | |
485 | */ | |
486 | public void setState( String state ) | |
487 | { | |
488 | 8 | this.state = state; |
489 | 8 | } //-- void setState( String ) |
490 | ||
491 | /** | |
492 | * Set the street name of the address of the author. | |
493 | * | |
494 | * @param street | |
495 | */ | |
496 | public void setStreet( String street ) | |
497 | { | |
498 | 8 | this.street = street; |
499 | 8 | } //-- void setStreet( String ) |
500 | ||
501 | /** | |
502 | * Set the title of the author. | |
503 | * | |
504 | * @param title | |
505 | */ | |
506 | public void setTitle( String title ) | |
507 | { | |
508 | 8 | this.title = title; |
509 | 8 | } //-- void setTitle( String ) |
510 | ||
511 | /** | |
512 | * Method toString. | |
513 | * | |
514 | * @return String | |
515 | */ | |
516 | public java.lang.String toString() | |
517 | { | |
518 | 8 | StringBuilder buf = new StringBuilder( 128 ); |
519 | ||
520 | 8 | buf.append( "firstName = '" ); |
521 | 8 | buf.append( getFirstName() ); |
522 | 8 | buf.append( "'" ); |
523 | 8 | buf.append( "\n" ); |
524 | 8 | buf.append( "lastName = '" ); |
525 | 8 | buf.append( getLastName() ); |
526 | 8 | buf.append( "'" ); |
527 | 8 | buf.append( "\n" ); |
528 | 8 | buf.append( "name = '" ); |
529 | 8 | buf.append( getName() ); |
530 | 8 | buf.append( "'" ); |
531 | 8 | buf.append( "\n" ); |
532 | 8 | buf.append( "initials = '" ); |
533 | 8 | buf.append( getInitials() ); |
534 | 8 | buf.append( "'" ); |
535 | 8 | buf.append( "\n" ); |
536 | 8 | buf.append( "title = '" ); |
537 | 8 | buf.append( getTitle() ); |
538 | 8 | buf.append( "'" ); |
539 | 8 | buf.append( "\n" ); |
540 | 8 | buf.append( "position = '" ); |
541 | 8 | buf.append( getPosition() ); |
542 | 8 | buf.append( "'" ); |
543 | 8 | buf.append( "\n" ); |
544 | 8 | buf.append( "email = '" ); |
545 | 8 | buf.append( getEmail() ); |
546 | 8 | buf.append( "'" ); |
547 | 8 | buf.append( "\n" ); |
548 | 8 | buf.append( "phoneNumber = '" ); |
549 | 8 | buf.append( getPhoneNumber() ); |
550 | 8 | buf.append( "'" ); |
551 | 8 | buf.append( "\n" ); |
552 | 8 | buf.append( "faxNumber = '" ); |
553 | 8 | buf.append( getFaxNumber() ); |
554 | 8 | buf.append( "'" ); |
555 | 8 | buf.append( "\n" ); |
556 | 8 | buf.append( "companyName = '" ); |
557 | 8 | buf.append( getCompanyName() ); |
558 | 8 | buf.append( "'" ); |
559 | 8 | buf.append( "\n" ); |
560 | 8 | buf.append( "street = '" ); |
561 | 8 | buf.append( getStreet() ); |
562 | 8 | buf.append( "'" ); |
563 | 8 | buf.append( "\n" ); |
564 | 8 | buf.append( "city = '" ); |
565 | 8 | buf.append( getCity() ); |
566 | 8 | buf.append( "'" ); |
567 | 8 | buf.append( "\n" ); |
568 | 8 | buf.append( "postalCode = '" ); |
569 | 8 | buf.append( getPostalCode() ); |
570 | 8 | buf.append( "'" ); |
571 | 8 | buf.append( "\n" ); |
572 | 8 | buf.append( "country = '" ); |
573 | 8 | buf.append( getCountry() ); |
574 | 8 | buf.append( "'" ); |
575 | 8 | buf.append( "\n" ); |
576 | 8 | buf.append( "state = '" ); |
577 | 8 | buf.append( getState() ); |
578 | 8 | buf.append( "'" ); |
579 | ||
580 | 8 | return buf.toString(); |
581 | } //-- java.lang.String toString() | |
582 | ||
583 | ||
584 | ||
585 | /** | |
586 | * Get the full name of the author. | |
587 | * | |
588 | * @return <code>name</code> if defined, <code>firsName lastName</code> otherwise. | |
589 | * @see #getName() | |
590 | * @see #getFirstName() | |
591 | * @see #getLastName() | |
592 | * @since 1.1.1 | |
593 | */ | |
594 | public String getFullName() | |
595 | { | |
596 | 0 | if ( getName() != null && getName().trim().length() > 0 ) |
597 | { | |
598 | 0 | return getName().trim(); |
599 | } | |
600 | ||
601 | 0 | return ( getFirstName() != null ? getFirstName().trim() : "null" ) + " " |
602 | + ( getLastName() != null ? getLastName().trim() : "null" ); | |
603 | } | |
604 | ||
605 | ||
606 | } |