View Javadoc

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