View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.9.1,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.doxia.document;
7   
8   /**
9    * A template that was used to create the document.
10   * 
11   * @version $Revision$ $Date$
12   */
13  @SuppressWarnings( "all" )
14  public class DocumentTemplate
15      implements java.io.Serializable
16  {
17  
18        //--------------------------/
19       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * 
24       *             The location of the document template.
25       *           
26       */
27      private String href;
28  
29      /**
30       * 
31       *             The name of the document template.
32       *           
33       */
34      private String title;
35  
36      /**
37       * 
38       *             The date and time when the template was last
39       * modified, prior
40       *             to being used to create the current document.
41       *             Use the ISO 8601 format
42       * "yyyy-MM-dd'T'HH:mm:ss.SSS" in xml.
43       *           
44       */
45      private java.util.Date date;
46  
47      /**
48       * 
49       *             The date as String (recommended format is ISO
50       * 8601) when the template was last modified.
51       *             Only used if <code>date</code> is not set.
52       *             @since 1.1.1
53       *           .
54       */
55      private String modifydate;
56  
57  
58        //-----------/
59       //- Methods -/
60      //-----------/
61  
62      /**
63       * Method equals.
64       * 
65       * @param other
66       * @return boolean
67       */
68      public boolean equals( Object other )
69      {
70          if ( this == other )
71          {
72              return true;
73          }
74  
75          if ( !( other instanceof DocumentTemplate ) )
76          {
77              return false;
78          }
79  
80          DocumentTemplate that = (DocumentTemplate) other;
81          boolean result = true;
82  
83          result = result && ( getHref() == null ? that.getHref() == null : getHref().equals( that.getHref() ) );
84          result = result && ( getTitle() == null ? that.getTitle() == null : getTitle().equals( that.getTitle() ) );
85          result = result && ( getDate() == null ? that.getDate() == null : getDate().equals( that.getDate() ) );
86          result = result && ( getModifydate() == null ? that.getModifydate() == null : getModifydate().equals( that.getModifydate() ) );
87  
88          return result;
89      } //-- boolean equals( Object )
90  
91      /**
92       * Get the date and time when the template was last modified,
93       * prior
94       *             to being used to create the current document.
95       *             Use the ISO 8601 format
96       * "yyyy-MM-dd'T'HH:mm:ss.SSS" in xml.
97       * 
98       * @return Date
99       */
100     public java.util.Date getDate()
101     {
102         return this.date;
103     } //-- java.util.Date getDate()
104 
105     /**
106      * Get the location of the document template.
107      * 
108      * @return String
109      */
110     public String getHref()
111     {
112         return this.href;
113     } //-- String getHref()
114 
115     /**
116      * Get the name of the document template.
117      * 
118      * @return String
119      */
120     public String getTitle()
121     {
122         return this.title;
123     } //-- String getTitle()
124 
125     /**
126      * Method hashCode.
127      * 
128      * @return int
129      */
130     public int hashCode()
131     {
132         int result = 17;
133 
134         result = 37 * result + ( href != null ? href.hashCode() : 0 );
135         result = 37 * result + ( title != null ? title.hashCode() : 0 );
136         result = 37 * result + ( date != null ? date.hashCode() : 0 );
137         result = 37 * result + ( modifydate != null ? modifydate.hashCode() : 0 );
138 
139         return result;
140     } //-- int hashCode()
141 
142     /**
143      * Set the date and time when the template was last modified,
144      * prior
145      *             to being used to create the current document.
146      *             Use the ISO 8601 format
147      * "yyyy-MM-dd'T'HH:mm:ss.SSS" in xml.
148      * 
149      * @param date
150      */
151     public void setDate( java.util.Date date )
152     {
153         this.date = date;
154     } //-- void setDate( java.util.Date )
155 
156     /**
157      * Set the location of the document template.
158      * 
159      * @param href
160      */
161     public void setHref( String href )
162     {
163         this.href = href;
164     } //-- void setHref( String )
165 
166     /**
167      * Set the date as String (recommended format is ISO 8601) when
168      * the template was last modified.
169      *             Only used if <code>date</code> is not set.
170      *             @since 1.1.1.
171      * 
172      * @param modifydate
173      */
174     public void setModifydate( String modifydate )
175     {
176         this.modifydate = modifydate;
177     } //-- void setModifydate( String )
178 
179     /**
180      * Set the name of the document template.
181      * 
182      * @param title
183      */
184     public void setTitle( String title )
185     {
186         this.title = title;
187     } //-- void setTitle( String )
188 
189     /**
190      * Method toString.
191      * 
192      * @return String
193      */
194     public java.lang.String toString()
195     {
196         StringBuilder buf = new StringBuilder( 128 );
197 
198         buf.append( "href = '" );
199         buf.append( getHref() );
200         buf.append( "'" );
201         buf.append( "\n" ); 
202         buf.append( "title = '" );
203         buf.append( getTitle() );
204         buf.append( "'" );
205         buf.append( "\n" ); 
206         buf.append( "date = '" );
207         buf.append( getDate() );
208         buf.append( "'" );
209         buf.append( "\n" ); 
210         buf.append( "modifydate = '" );
211         buf.append( getModifydate() );
212         buf.append( "'" );
213 
214         return buf.toString();
215     } //-- java.lang.String toString()
216 
217     
218             
219     /** ISO 8601 date format, i.e. <code>yyyy-MM-dd</code> **/
220     private static final java.text.DateFormat ISO_8601_FORMAT = new java.text.SimpleDateFormat( "yyyy-MM-dd", java.util.Locale.ENGLISH );
221 
222     /**
223      * Get the date and time when the template was last modified.
224      *
225      * @return the <code>getDate()</code> if setted, formatted using ISO-8601 English format, otherwise return
226      * the <code>modifydate</code>.
227      * @since 1.1.1
228      * @see #getDate()
229      */
230     public String getModifydate()
231     {
232         if ( getDate() != null )
233         {
234             return ISO_8601_FORMAT.format( getDate() );
235         }
236 
237         return this.modifydate;
238     }
239             
240           
241 }