001// =================== DO NOT EDIT THIS FILE ==================== 002// Generated by Modello 1.9.1, 003// any modifications will be overwritten. 004// ============================================================== 005 006package org.apache.maven.doxia.document; 007 008/** 009 * A template that was used to create the document. 010 * 011 * @version $Revision$ $Date$ 012 */ 013@SuppressWarnings( "all" ) 014public class DocumentTemplate 015 implements java.io.Serializable 016{ 017 018 //--------------------------/ 019 //- Class/Member Variables -/ 020 //--------------------------/ 021 022 /** 023 * 024 * The location of the document template. 025 * 026 */ 027 private String href; 028 029 /** 030 * 031 * The name of the document template. 032 * 033 */ 034 private String title; 035 036 /** 037 * 038 * The date and time when the template was last 039 * modified, prior 040 * to being used to create the current document. 041 * Use the ISO 8601 format 042 * "yyyy-MM-dd'T'HH:mm:ss.SSS" in xml. 043 * 044 */ 045 private java.util.Date date; 046 047 /** 048 * 049 * The date as String (recommended format is ISO 050 * 8601) when the template was last modified. 051 * Only used if <code>date</code> is not set. 052 * @since 1.1.1 053 * . 054 */ 055 private String modifydate; 056 057 058 //-----------/ 059 //- Methods -/ 060 //-----------/ 061 062 /** 063 * Method equals. 064 * 065 * @param other 066 * @return boolean 067 */ 068 public boolean equals( Object other ) 069 { 070 if ( this == other ) 071 { 072 return true; 073 } 074 075 if ( !( other instanceof DocumentTemplate ) ) 076 { 077 return false; 078 } 079 080 DocumentTemplate that = (DocumentTemplate) other; 081 boolean result = true; 082 083 result = result && ( getHref() == null ? that.getHref() == null : getHref().equals( that.getHref() ) ); 084 result = result && ( getTitle() == null ? that.getTitle() == null : getTitle().equals( that.getTitle() ) ); 085 result = result && ( getDate() == null ? that.getDate() == null : getDate().equals( that.getDate() ) ); 086 result = result && ( getModifydate() == null ? that.getModifydate() == null : getModifydate().equals( that.getModifydate() ) ); 087 088 return result; 089 } //-- boolean equals( Object ) 090 091 /** 092 * Get the date and time when the template was last modified, 093 * prior 094 * to being used to create the current document. 095 * Use the ISO 8601 format 096 * "yyyy-MM-dd'T'HH:mm:ss.SSS" in xml. 097 * 098 * @return Date 099 */ 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}