Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PublishDate |
|
| 2.625;2,625 |
1 | /* | |
2 | =================== DO NOT EDIT THIS FILE ==================== | |
3 | Generated by Modello 1.4.1 on 2012-04-17 22:28:45, | |
4 | any modifications will be overwritten. | |
5 | ============================================================== | |
6 | */ | |
7 | ||
8 | package org.apache.maven.doxia.site.decoration; | |
9 | ||
10 | /** | |
11 | * Modify display properties for date published. | |
12 | * | |
13 | * @version $Revision$ $Date$ | |
14 | */ | |
15 | @SuppressWarnings( "all" ) | |
16 | 18 | public class PublishDate |
17 | implements java.io.Serializable, java.lang.Cloneable | |
18 | { | |
19 | ||
20 | //--------------------------/ | |
21 | //- Class/Member Variables -/ | |
22 | //--------------------------/ | |
23 | ||
24 | /** | |
25 | * Where to place the date published (left, right, | |
26 | * navigation-top, navigation-bottom, bottom). | |
27 | */ | |
28 | private String position; | |
29 | ||
30 | /** | |
31 | * Date format to use. The default is ISO-8601 yyyy-MM-dd. | |
32 | */ | |
33 | 18 | private String format = "yyyy-MM-dd"; |
34 | ||
35 | ||
36 | //-----------/ | |
37 | //- Methods -/ | |
38 | //-----------/ | |
39 | ||
40 | /** | |
41 | * Method clone. | |
42 | * | |
43 | * @return PublishDate | |
44 | */ | |
45 | public PublishDate clone() | |
46 | { | |
47 | try | |
48 | { | |
49 | 4 | PublishDate copy = (PublishDate) super.clone(); |
50 | ||
51 | 4 | return copy; |
52 | } | |
53 | 0 | catch ( java.lang.Exception ex ) |
54 | { | |
55 | 0 | throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() |
56 | + " does not support clone()" ).initCause( ex ); | |
57 | } | |
58 | } //-- PublishDate clone() | |
59 | ||
60 | /** | |
61 | * Method equals. | |
62 | * | |
63 | * @param other | |
64 | * @return boolean | |
65 | */ | |
66 | public boolean equals( Object other ) | |
67 | { | |
68 | 14 | if ( this == other ) |
69 | { | |
70 | 0 | return true; |
71 | } | |
72 | ||
73 | 14 | if ( !( other instanceof PublishDate ) ) |
74 | { | |
75 | 0 | return false; |
76 | } | |
77 | ||
78 | 14 | PublishDate that = (PublishDate) other; |
79 | 14 | boolean result = true; |
80 | ||
81 | 14 | result = result && ( getPosition() == null ? that.getPosition() == null : getPosition().equals( that.getPosition() ) ); |
82 | 14 | result = result && ( getFormat() == null ? that.getFormat() == null : getFormat().equals( that.getFormat() ) ); |
83 | ||
84 | 14 | return result; |
85 | } //-- boolean equals( Object ) | |
86 | ||
87 | /** | |
88 | * Get date format to use. The default is ISO-8601 yyyy-MM-dd. | |
89 | * | |
90 | * @return String | |
91 | */ | |
92 | public String getFormat() | |
93 | { | |
94 | 42 | return this.format; |
95 | } //-- String getFormat() | |
96 | ||
97 | /** | |
98 | * Get where to place the date published (left, right, | |
99 | * navigation-top, navigation-bottom, bottom). | |
100 | * | |
101 | * @return String | |
102 | */ | |
103 | public String getPosition() | |
104 | { | |
105 | 42 | return this.position; |
106 | } //-- String getPosition() | |
107 | ||
108 | /** | |
109 | * Method hashCode. | |
110 | * | |
111 | * @return int | |
112 | */ | |
113 | public int hashCode() | |
114 | { | |
115 | 0 | int result = 17; |
116 | ||
117 | 0 | result = 37 * result + ( position != null ? position.hashCode() : 0 ); |
118 | 0 | result = 37 * result + ( format != null ? format.hashCode() : 0 ); |
119 | ||
120 | 0 | return result; |
121 | } //-- int hashCode() | |
122 | ||
123 | /** | |
124 | * Set date format to use. The default is ISO-8601 yyyy-MM-dd. | |
125 | * | |
126 | * @param format | |
127 | */ | |
128 | public void setFormat( String format ) | |
129 | { | |
130 | 18 | this.format = format; |
131 | 18 | } //-- void setFormat( String ) |
132 | ||
133 | /** | |
134 | * Set where to place the date published (left, right, | |
135 | * navigation-top, navigation-bottom, bottom). | |
136 | * | |
137 | * @param position | |
138 | */ | |
139 | public void setPosition( String position ) | |
140 | { | |
141 | 18 | this.position = position; |
142 | 18 | } //-- void setPosition( String ) |
143 | ||
144 | /** | |
145 | * Method toString. | |
146 | * | |
147 | * @return String | |
148 | */ | |
149 | public java.lang.String toString() | |
150 | { | |
151 | 0 | StringBuilder buf = new StringBuilder( 128 ); |
152 | ||
153 | 0 | buf.append( "position = '" ); |
154 | 0 | buf.append( getPosition() ); |
155 | 0 | buf.append( "'" ); |
156 | 0 | buf.append( "\n" ); |
157 | 0 | buf.append( "format = '" ); |
158 | 0 | buf.append( getFormat() ); |
159 | 0 | buf.append( "'" ); |
160 | ||
161 | 0 | return buf.toString(); |
162 | } //-- java.lang.String toString() | |
163 | ||
164 | } |