001// =================== DO NOT EDIT THIS FILE ==================== 002// Generated by Modello 1.7, 003// any modifications will be overwritten. 004// ============================================================== 005 006package org.apache.archiva.model; 007 008/** 009 * Class ArchivaRepositoryMetadata. 010 * 011 * @version $Revision$ $Date$ 012 */ 013@SuppressWarnings( "all" ) 014public class ArchivaRepositoryMetadata 015 implements java.io.Serializable 016{ 017 018 //--------------------------/ 019 //- Class/Member Variables -/ 020 //--------------------------/ 021 022 /** 023 * 024 * The Group ID of the metadata. 025 * 026 */ 027 private String groupId; 028 029 /** 030 * 031 * The Artifact ID of the metadata. 032 * 033 */ 034 private String artifactId; 035 036 /** 037 * 038 * The Version of the metadata. 039 * 040 */ 041 private String version; 042 043 /** 044 * 045 * The latest version id. 046 * 047 */ 048 private String latestVersion; 049 050 /** 051 * 052 * The released version id. 053 * 054 */ 055 private String releasedVersion; 056 057 /** 058 * 059 * The snapshot version id. 060 * 061 */ 062 private SnapshotVersion snapshotVersion; 063 064 /** 065 * Field plugins. 066 */ 067 private java.util.List<Plugin> plugins; 068 069 /** 070 * Field availableVersions. 071 */ 072 private java.util.List<String> availableVersions; 073 074 /** 075 * 076 * When the metadata was last updated. 077 * 078 */ 079 private String lastUpdated; 080 081 /** 082 * 083 * The Last Modified Timestamp of this file. 084 * 085 */ 086 private java.util.Date fileLastModified; 087 088 /** 089 * 090 * The size of the artifact on disk. 091 * 092 */ 093 private long fileSize = 0L; 094 095 096 //-----------/ 097 //- Methods -/ 098 //-----------/ 099 100 /** 101 * Method addAvailableVersion. 102 * 103 * @param string 104 */ 105 public void addAvailableVersion( String string ) 106 { 107 getAvailableVersions().add( string ); 108 } //-- void addAvailableVersion( String ) 109 110 /** 111 * Method addPlugin. 112 * 113 * @param plugin 114 */ 115 public void addPlugin( Plugin plugin ) 116 { 117 getPlugins().add( plugin ); 118 } //-- void addPlugin( Plugin ) 119 120 /** 121 * Method equals. 122 * 123 * @param other 124 * @return boolean 125 */ 126 public boolean equals( Object other ) 127 { 128 if ( this == other ) 129 { 130 return true; 131 } 132 133 if ( !( other instanceof ArchivaRepositoryMetadata ) ) 134 { 135 return false; 136 } 137 138 ArchivaRepositoryMetadata that = (ArchivaRepositoryMetadata) other; 139 boolean result = true; 140 141 result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) ); 142 result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); 143 result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) ); 144 145 return result; 146 } //-- boolean equals( Object ) 147 148 /** 149 * Get the Artifact ID of the metadata. 150 * 151 * @return String 152 */ 153 public String getArtifactId() 154 { 155 return this.artifactId; 156 } //-- String getArtifactId() 157 158 /** 159 * Method getAvailableVersions. 160 * 161 * @return List 162 */ 163 public java.util.List<String> getAvailableVersions() 164 { 165 if ( this.availableVersions == null ) 166 { 167 this.availableVersions = new java.util.ArrayList<String>(); 168 } 169 170 return this.availableVersions; 171 } //-- java.util.List<String> getAvailableVersions() 172 173 /** 174 * Get the Last Modified Timestamp of this file. 175 * 176 * @return Date 177 */ 178 public java.util.Date getFileLastModified() 179 { 180 return this.fileLastModified; 181 } //-- java.util.Date getFileLastModified() 182 183 /** 184 * Get the size of the artifact on disk. 185 * 186 * @return long 187 */ 188 public long getFileSize() 189 { 190 return this.fileSize; 191 } //-- long getFileSize() 192 193 /** 194 * Get the Group ID of the metadata. 195 * 196 * @return String 197 */ 198 public String getGroupId() 199 { 200 return this.groupId; 201 } //-- String getGroupId() 202 203 /** 204 * Get when the metadata was last updated. 205 * 206 * @return String 207 */ 208 public String getLastUpdated() 209 { 210 return this.lastUpdated; 211 } //-- String getLastUpdated() 212 213 /** 214 * Get the latest version id. 215 * 216 * @return String 217 */ 218 public String getLatestVersion() 219 { 220 return this.latestVersion; 221 } //-- String getLatestVersion() 222 223 /** 224 * Method getPlugins. 225 * 226 * @return List 227 */ 228 public java.util.List<Plugin> getPlugins() 229 { 230 if ( this.plugins == null ) 231 { 232 this.plugins = new java.util.ArrayList<Plugin>(); 233 } 234 235 return this.plugins; 236 } //-- java.util.List<Plugin> getPlugins() 237 238 /** 239 * Get the released version id. 240 * 241 * @return String 242 */ 243 public String getReleasedVersion() 244 { 245 return this.releasedVersion; 246 } //-- String getReleasedVersion() 247 248 /** 249 * Get the snapshot version id. 250 * 251 * @return SnapshotVersion 252 */ 253 public SnapshotVersion getSnapshotVersion() 254 { 255 return this.snapshotVersion; 256 } //-- SnapshotVersion getSnapshotVersion() 257 258 /** 259 * Get the Version of the metadata. 260 * 261 * @return String 262 */ 263 public String getVersion() 264 { 265 return this.version; 266 } //-- String getVersion() 267 268 /** 269 * Method hashCode. 270 * 271 * @return int 272 */ 273 public int hashCode() 274 { 275 int result = 17; 276 277 result = 37 * result + ( groupId != null ? groupId.hashCode() : 0 ); 278 result = 37 * result + ( artifactId != null ? artifactId.hashCode() : 0 ); 279 result = 37 * result + ( version != null ? version.hashCode() : 0 ); 280 281 return result; 282 } //-- int hashCode() 283 284 /** 285 * Method removeAvailableVersion. 286 * 287 * @param string 288 */ 289 public void removeAvailableVersion( String string ) 290 { 291 getAvailableVersions().remove( string ); 292 } //-- void removeAvailableVersion( String ) 293 294 /** 295 * Method removePlugin. 296 * 297 * @param plugin 298 */ 299 public void removePlugin( Plugin plugin ) 300 { 301 getPlugins().remove( plugin ); 302 } //-- void removePlugin( Plugin ) 303 304 /** 305 * Set the Artifact ID of the metadata. 306 * 307 * @param artifactId 308 */ 309 public void setArtifactId( String artifactId ) 310 { 311 this.artifactId = artifactId; 312 } //-- void setArtifactId( String ) 313 314 /** 315 * Set the list of available version ids. 316 * 317 * @param availableVersions 318 */ 319 public void setAvailableVersions( java.util.List<String> availableVersions ) 320 { 321 this.availableVersions = availableVersions; 322 } //-- void setAvailableVersions( java.util.List ) 323 324 /** 325 * Set the Last Modified Timestamp of this file. 326 * 327 * @param fileLastModified 328 */ 329 public void setFileLastModified( java.util.Date fileLastModified ) 330 { 331 this.fileLastModified = fileLastModified; 332 } //-- void setFileLastModified( java.util.Date ) 333 334 /** 335 * Set the size of the artifact on disk. 336 * 337 * @param fileSize 338 */ 339 public void setFileSize( long fileSize ) 340 { 341 this.fileSize = fileSize; 342 } //-- void setFileSize( long ) 343 344 /** 345 * Set the Group ID of the metadata. 346 * 347 * @param groupId 348 */ 349 public void setGroupId( String groupId ) 350 { 351 this.groupId = groupId; 352 } //-- void setGroupId( String ) 353 354 /** 355 * Set when the metadata was last updated. 356 * 357 * @param lastUpdated 358 */ 359 public void setLastUpdated( String lastUpdated ) 360 { 361 this.lastUpdated = lastUpdated; 362 } //-- void setLastUpdated( String ) 363 364 /** 365 * Set the latest version id. 366 * 367 * @param latestVersion 368 */ 369 public void setLatestVersion( String latestVersion ) 370 { 371 this.latestVersion = latestVersion; 372 } //-- void setLatestVersion( String ) 373 374 /** 375 * Set the available plugins. 376 * 377 * @param plugins 378 */ 379 public void setPlugins( java.util.List<Plugin> plugins ) 380 { 381 this.plugins = plugins; 382 } //-- void setPlugins( java.util.List ) 383 384 /** 385 * Set the released version id. 386 * 387 * @param releasedVersion 388 */ 389 public void setReleasedVersion( String releasedVersion ) 390 { 391 this.releasedVersion = releasedVersion; 392 } //-- void setReleasedVersion( String ) 393 394 /** 395 * Set the snapshot version id. 396 * 397 * @param snapshotVersion 398 */ 399 public void setSnapshotVersion( SnapshotVersion snapshotVersion ) 400 { 401 this.snapshotVersion = snapshotVersion; 402 } //-- void setSnapshotVersion( SnapshotVersion ) 403 404 /** 405 * Set the Version of the metadata. 406 * 407 * @param version 408 */ 409 public void setVersion( String version ) 410 { 411 this.version = version; 412 } //-- void setVersion( String ) 413 414 /** 415 * Method toString. 416 * 417 * @return String 418 */ 419 public java.lang.String toString() 420 { 421 StringBuilder buf = new StringBuilder( 128 ); 422 423 buf.append( "groupId = '" ); 424 buf.append( getGroupId() ); 425 buf.append( "'" ); 426 buf.append( "\n" ); 427 buf.append( "artifactId = '" ); 428 buf.append( getArtifactId() ); 429 buf.append( "'" ); 430 buf.append( "\n" ); 431 buf.append( "version = '" ); 432 buf.append( getVersion() ); 433 buf.append( "'" ); 434 435 return buf.toString(); 436 } //-- java.lang.String toString() 437 438 439 private static final long serialVersionUID = 914715358219606100L; 440 441 442 public void updateTimestamp() 443 { 444 setLastUpdatedTimestamp( new java.util.Date() ); 445 } 446 447 public void setLastUpdatedTimestamp( java.util.Date date ) 448 { 449 java.util.TimeZone timezone = java.util.TimeZone.getTimeZone( "UTC" ); 450 java.text.DateFormat fmt = new java.text.SimpleDateFormat( "yyyyMMddHHmmss" ); 451 fmt.setTimeZone( timezone ); 452 setLastUpdated( fmt.format( date ) ); 453 } 454 455}