1
2
3
4
5
6
7
8 package org.apache.maven.doxia.document;
9
10
11
12
13
14
15 @SuppressWarnings( "all" )
16 public class DocumentCover
17 implements java.io.Serializable
18 {
19
20
21
22
23
24
25
26
27
28
29 private String coverTitle;
30
31
32
33
34
35
36 private String coverSubTitle;
37
38
39
40
41
42
43
44 private String coverVersion;
45
46
47
48
49
50
51
52
53
54
55 private String coverType;
56
57
58
59
60
61
62
63
64 private java.util.Date coverDate;
65
66
67
68
69
70
71
72
73
74 private String coverdate;
75
76
77
78
79 private java.util.List<DocumentAuthor> authors;
80
81
82
83
84
85
86
87
88
89
90 private String author;
91
92
93
94
95
96
97 private String projectName;
98
99
100
101
102
103
104
105 private String projectLogo;
106
107
108
109
110
111
112
113
114 private String companyName;
115
116
117
118
119
120
121
122 private String companyLogo;
123
124
125
126
127
128
129
130
131
132
133
134 public void addAuthor( DocumentAuthor documentAuthor )
135 {
136 getAuthors().add( documentAuthor );
137 }
138
139
140
141
142
143
144
145 public boolean equals( Object other )
146 {
147 if ( this == other )
148 {
149 return true;
150 }
151
152 if ( !( other instanceof DocumentCover ) )
153 {
154 return false;
155 }
156
157 DocumentCover that = (DocumentCover) other;
158 boolean result = true;
159
160 result = result && ( getCoverTitle() == null ? that.getCoverTitle() == null : getCoverTitle().equals( that.getCoverTitle() ) );
161 result = result && ( getCoverSubTitle() == null ? that.getCoverSubTitle() == null : getCoverSubTitle().equals( that.getCoverSubTitle() ) );
162 result = result && ( getCoverVersion() == null ? that.getCoverVersion() == null : getCoverVersion().equals( that.getCoverVersion() ) );
163 result = result && ( getCoverType() == null ? that.getCoverType() == null : getCoverType().equals( that.getCoverType() ) );
164 result = result && ( getCoverDate() == null ? that.getCoverDate() == null : getCoverDate().equals( that.getCoverDate() ) );
165 result = result && ( getCoverdate() == null ? that.getCoverdate() == null : getCoverdate().equals( that.getCoverdate() ) );
166 result = result && ( getAuthors() == null ? that.getAuthors() == null : getAuthors().equals( that.getAuthors() ) );
167 result = result && ( getAuthor() == null ? that.getAuthor() == null : getAuthor().equals( that.getAuthor() ) );
168 result = result && ( getProjectName() == null ? that.getProjectName() == null : getProjectName().equals( that.getProjectName() ) );
169 result = result && ( getProjectLogo() == null ? that.getProjectLogo() == null : getProjectLogo().equals( that.getProjectLogo() ) );
170 result = result && ( getCompanyName() == null ? that.getCompanyName() == null : getCompanyName().equals( that.getCompanyName() ) );
171 result = result && ( getCompanyLogo() == null ? that.getCompanyLogo() == null : getCompanyLogo().equals( that.getCompanyLogo() ) );
172
173 return result;
174 }
175
176
177
178
179
180
181
182
183
184
185 public String getAuthor()
186 {
187 return this.author;
188 }
189
190
191
192
193
194
195 public java.util.List<DocumentAuthor> getAuthors()
196 {
197 if ( this.authors == null )
198 {
199 this.authors = new java.util.ArrayList<DocumentAuthor>();
200 }
201
202 return this.authors;
203 }
204
205
206
207
208
209
210
211 public String getCompanyLogo()
212 {
213 return this.companyLogo;
214 }
215
216
217
218
219
220
221
222
223 public String getCompanyName()
224 {
225 return this.companyName;
226 }
227
228
229
230
231
232
233
234
235 public java.util.Date getCoverDate()
236 {
237 return this.coverDate;
238 }
239
240
241
242
243
244
245 public String getCoverSubTitle()
246 {
247 return this.coverSubTitle;
248 }
249
250
251
252
253
254
255 public String getCoverTitle()
256 {
257 return this.coverTitle;
258 }
259
260
261
262
263
264
265
266
267
268
269 public String getCoverType()
270 {
271 return this.coverType;
272 }
273
274
275
276
277
278
279
280 public String getCoverVersion()
281 {
282 return this.coverVersion;
283 }
284
285
286
287
288
289
290
291 public String getProjectLogo()
292 {
293 return this.projectLogo;
294 }
295
296
297
298
299
300
301 public String getProjectName()
302 {
303 return this.projectName;
304 }
305
306
307
308
309
310
311 public int hashCode()
312 {
313 int result = 17;
314
315 result = 37 * result + ( coverTitle != null ? coverTitle.hashCode() : 0 );
316 result = 37 * result + ( coverSubTitle != null ? coverSubTitle.hashCode() : 0 );
317 result = 37 * result + ( coverVersion != null ? coverVersion.hashCode() : 0 );
318 result = 37 * result + ( coverType != null ? coverType.hashCode() : 0 );
319 result = 37 * result + ( coverDate != null ? coverDate.hashCode() : 0 );
320 result = 37 * result + ( coverdate != null ? coverdate.hashCode() : 0 );
321 result = 37 * result + ( authors != null ? authors.hashCode() : 0 );
322 result = 37 * result + ( author != null ? author.hashCode() : 0 );
323 result = 37 * result + ( projectName != null ? projectName.hashCode() : 0 );
324 result = 37 * result + ( projectLogo != null ? projectLogo.hashCode() : 0 );
325 result = 37 * result + ( companyName != null ? companyName.hashCode() : 0 );
326 result = 37 * result + ( companyLogo != null ? companyLogo.hashCode() : 0 );
327
328 return result;
329 }
330
331
332
333
334
335
336 public void removeAuthor( DocumentAuthor documentAuthor )
337 {
338 getAuthors().remove( documentAuthor );
339 }
340
341
342
343
344
345
346
347
348
349
350 public void setAuthor( String author )
351 {
352 this.author = author;
353 }
354
355
356
357
358
359
360
361 public void setAuthors( java.util.List<DocumentAuthor> authors )
362 {
363 this.authors = authors;
364 }
365
366
367
368
369
370
371
372 public void setCompanyLogo( String companyLogo )
373 {
374 this.companyLogo = companyLogo;
375 }
376
377
378
379
380
381
382
383
384 public void setCompanyName( String companyName )
385 {
386 this.companyName = companyName;
387 }
388
389
390
391
392
393
394
395
396 public void setCoverDate( java.util.Date coverDate )
397 {
398 this.coverDate = coverDate;
399 }
400
401
402
403
404
405
406 public void setCoverSubTitle( String coverSubTitle )
407 {
408 this.coverSubTitle = coverSubTitle;
409 }
410
411
412
413
414
415
416 public void setCoverTitle( String coverTitle )
417 {
418 this.coverTitle = coverTitle;
419 }
420
421
422
423
424
425
426
427
428
429
430 public void setCoverType( String coverType )
431 {
432 this.coverType = coverType;
433 }
434
435
436
437
438
439
440
441 public void setCoverVersion( String coverVersion )
442 {
443 this.coverVersion = coverVersion;
444 }
445
446
447
448
449
450
451
452
453
454 public void setCoverdate( String coverdate )
455 {
456 this.coverdate = coverdate;
457 }
458
459
460
461
462
463
464
465 public void setProjectLogo( String projectLogo )
466 {
467 this.projectLogo = projectLogo;
468 }
469
470
471
472
473
474
475 public void setProjectName( String projectName )
476 {
477 this.projectName = projectName;
478 }
479
480
481
482
483
484
485 public java.lang.String toString()
486 {
487 StringBuilder buf = new StringBuilder( 128 );
488
489 buf.append( "coverTitle = '" );
490 buf.append( getCoverTitle() );
491 buf.append( "'" );
492 buf.append( "\n" );
493 buf.append( "coverSubTitle = '" );
494 buf.append( getCoverSubTitle() );
495 buf.append( "'" );
496 buf.append( "\n" );
497 buf.append( "coverVersion = '" );
498 buf.append( getCoverVersion() );
499 buf.append( "'" );
500 buf.append( "\n" );
501 buf.append( "coverType = '" );
502 buf.append( getCoverType() );
503 buf.append( "'" );
504 buf.append( "\n" );
505 buf.append( "coverDate = '" );
506 buf.append( getCoverDate() );
507 buf.append( "'" );
508 buf.append( "\n" );
509 buf.append( "coverdate = '" );
510 buf.append( getCoverdate() );
511 buf.append( "'" );
512 buf.append( "\n" );
513 buf.append( "authors = '" );
514 buf.append( getAuthors() );
515 buf.append( "'" );
516 buf.append( "\n" );
517 buf.append( "author = '" );
518 buf.append( getAuthor() );
519 buf.append( "'" );
520 buf.append( "\n" );
521 buf.append( "projectName = '" );
522 buf.append( getProjectName() );
523 buf.append( "'" );
524 buf.append( "\n" );
525 buf.append( "projectLogo = '" );
526 buf.append( getProjectLogo() );
527 buf.append( "'" );
528 buf.append( "\n" );
529 buf.append( "companyName = '" );
530 buf.append( getCompanyName() );
531 buf.append( "'" );
532 buf.append( "\n" );
533 buf.append( "companyLogo = '" );
534 buf.append( getCompanyLogo() );
535 buf.append( "'" );
536
537 return buf.toString();
538 }
539
540
541
542
543
544
545
546
547
548
549 public String getAllAuthorNames()
550 {
551 StringBuffer sb = new StringBuffer();
552 if ( getAuthor() != null && getAuthor().trim().length() > 0 )
553 {
554 return getAuthor().trim();
555 }
556
557 if ( getAuthors() != null )
558 {
559 for ( java.util.Iterator it = getAuthors().iterator(); it.hasNext(); )
560 {
561 DocumentAuthor author = (DocumentAuthor) it.next();
562
563 sb.append( author.getFullName().trim() );
564
565 if ( it.hasNext() )
566 {
567 sb.append( ", " );
568 }
569 }
570 }
571
572 return sb.toString();
573 }
574
575
576 private static final java.text.DateFormat ISO_8601_FORMAT = new java.text.SimpleDateFormat( "yyyy-MM-dd", java.util.Locale.ENGLISH );
577
578
579
580
581
582
583
584
585
586 public String getCoverdate()
587 {
588 if ( getCoverDate() != null )
589 {
590 return ISO_8601_FORMAT.format( getCoverDate() );
591 }
592
593 return this.coverdate;
594 }
595
596
597 }