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