1 package org.apache.archiva.model; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 /** 23 * Class ArchivaArtifactModel. 24 * 25 * @version $Revision$ $Date$ 26 */ 27 @SuppressWarnings( "all" ) 28 public class ArchivaArtifactModel 29 implements java.io.Serializable 30 { 31 32 //--------------------------/ 33 //- Class/Member Variables -/ 34 //--------------------------/ 35 36 /** 37 * 38 * The Group ID of the repository content. 39 * 40 */ 41 private String groupId; 42 43 /** 44 * 45 * The Artifact ID of the repository content. 46 * 47 */ 48 private String artifactId; 49 50 /** 51 * 52 * The version of the repository content. 53 * 54 */ 55 private String version; 56 57 /** 58 * 59 * The classifier for this artifact. 60 * 61 */ 62 private String classifier; 63 64 /** 65 * 66 * The type of artifact. 67 * 68 */ 69 private String type; 70 71 /** 72 * 73 * The repository associated with this content. 74 * 75 */ 76 private String repositoryId; 77 78 /** 79 * 80 * True if this is a snapshot. 81 * 82 */ 83 private boolean snapshot = false; 84 85 /** 86 * 87 * The MD5 checksum for the artifact file. 88 * 89 */ 90 private String checksumMD5; 91 92 /** 93 * 94 * The SHA1 checksum for the artifact file. 95 * 96 */ 97 private String checksumSHA1; 98 99 /** 100 * 101 * The Last Modified Timestamp of this artifact. 102 * 103 */ 104 private java.util.Date lastModified; 105 106 /** 107 * 108 * The size of the artifact on disk. 109 * 110 */ 111 private long size = 0L; 112 113 /** 114 * 115 * When this artifact was gathered or discovered 116 * from the repository. 117 * 118 */ 119 private java.util.Date whenGathered; 120 121 122 //-----------/ 123 //- Methods -/ 124 //-----------/ 125 126 /** 127 * Method equals. 128 * 129 * @param other 130 * @return boolean 131 */ 132 public boolean equals( Object other ) 133 { 134 if ( this == other ) 135 { 136 return true; 137 } 138 139 if ( !( other instanceof ArchivaArtifactModel ) ) 140 { 141 return false; 142 } 143 144 ArchivaArtifactModelorg/apache/archiva/model/ArchivaArtifactModel.html#ArchivaArtifactModel">ArchivaArtifactModel that = (ArchivaArtifactModel) other; 145 boolean result = true; 146 147 result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) ); 148 result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); 149 result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) ); 150 result = result && ( getClassifier() == null ? that.getClassifier() == null : getClassifier().equals( that.getClassifier() ) ); 151 result = result && ( getType() == null ? that.getType() == null : getType().equals( that.getType() ) ); 152 result = result && ( getRepositoryId() == null ? that.getRepositoryId() == null : getRepositoryId().equals( that.getRepositoryId() ) ); 153 154 return result; 155 } //-- boolean equals( Object ) 156 157 /** 158 * Get the Artifact ID of the repository content. 159 * 160 * @return String 161 */ 162 public String getArtifactId() 163 { 164 return this.artifactId; 165 } //-- String getArtifactId() 166 167 /** 168 * Get the MD5 checksum for the artifact file. 169 * 170 * @return String 171 */ 172 public String getChecksumMD5() 173 { 174 return this.checksumMD5; 175 } //-- String getChecksumMD5() 176 177 /** 178 * Get the SHA1 checksum for the artifact file. 179 * 180 * @return String 181 */ 182 public String getChecksumSHA1() 183 { 184 return this.checksumSHA1; 185 } //-- String getChecksumSHA1() 186 187 /** 188 * Get the classifier for this artifact. 189 * 190 * @return String 191 */ 192 public String getClassifier() 193 { 194 return this.classifier; 195 } //-- String getClassifier() 196 197 /** 198 * Get the Group ID of the repository content. 199 * 200 * @return String 201 */ 202 public String getGroupId() 203 { 204 return this.groupId; 205 } //-- String getGroupId() 206 207 /** 208 * Get the Last Modified Timestamp of this artifact. 209 * 210 * @return Date 211 */ 212 public java.util.Date getLastModified() 213 { 214 return this.lastModified; 215 } //-- java.util.Date getLastModified() 216 217 /** 218 * Get the repository associated with this content. 219 * 220 * @return String 221 */ 222 public String getRepositoryId() 223 { 224 return this.repositoryId; 225 } //-- String getRepositoryId() 226 227 /** 228 * Get the size of the artifact on disk. 229 * 230 * @return long 231 */ 232 public long getSize() 233 { 234 return this.size; 235 } //-- long getSize() 236 237 /** 238 * Get the type of artifact. 239 * 240 * @return String 241 */ 242 public String getType() 243 { 244 return this.type; 245 } //-- String getType() 246 247 /** 248 * Get the version of the repository content. 249 * 250 * @return String 251 */ 252 public String getVersion() 253 { 254 return this.version; 255 } //-- String getVersion() 256 257 /** 258 * Get when this artifact was gathered or discovered from the 259 * repository. 260 * 261 * @return Date 262 */ 263 public java.util.Date getWhenGathered() 264 { 265 return this.whenGathered; 266 } //-- java.util.Date getWhenGathered() 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 result = 37 * result + ( classifier != null ? classifier.hashCode() : 0 ); 281 result = 37 * result + ( type != null ? type.hashCode() : 0 ); 282 result = 37 * result + ( repositoryId != null ? repositoryId.hashCode() : 0 ); 283 284 return result; 285 } //-- int hashCode() 286 287 /** 288 * Get true if this is a snapshot. 289 * 290 * @return boolean 291 */ 292 public boolean isSnapshot() 293 { 294 return this.snapshot; 295 } //-- boolean isSnapshot() 296 297 /** 298 * Set the Artifact ID of the repository content. 299 * 300 * @param artifactId 301 */ 302 public void setArtifactId( String artifactId ) 303 { 304 this.artifactId = artifactId; 305 } //-- void setArtifactId( String ) 306 307 /** 308 * Set the MD5 checksum for the artifact file. 309 * 310 * @param checksumMD5 311 */ 312 public void setChecksumMD5( String checksumMD5 ) 313 { 314 this.checksumMD5 = checksumMD5; 315 } //-- void setChecksumMD5( String ) 316 317 /** 318 * Set the SHA1 checksum for the artifact file. 319 * 320 * @param checksumSHA1 321 */ 322 public void setChecksumSHA1( String checksumSHA1 ) 323 { 324 this.checksumSHA1 = checksumSHA1; 325 } //-- void setChecksumSHA1( String ) 326 327 /** 328 * Set the classifier for this artifact. 329 * 330 * @param classifier 331 */ 332 public void setClassifier( String classifier ) 333 { 334 this.classifier = classifier; 335 } //-- void setClassifier( String ) 336 337 /** 338 * Set the Group ID of the repository content. 339 * 340 * @param groupId 341 */ 342 public void setGroupId( String groupId ) 343 { 344 this.groupId = groupId; 345 } //-- void setGroupId( String ) 346 347 /** 348 * Set the Last Modified Timestamp of this artifact. 349 * 350 * @param lastModified 351 */ 352 public void setLastModified( java.util.Date lastModified ) 353 { 354 this.lastModified = lastModified; 355 } //-- void setLastModified( java.util.Date ) 356 357 /** 358 * Set the repository associated with this content. 359 * 360 * @param repositoryId 361 */ 362 public void setRepositoryId( String repositoryId ) 363 { 364 this.repositoryId = repositoryId; 365 } //-- void setRepositoryId( String ) 366 367 /** 368 * Set the size of the artifact on disk. 369 * 370 * @param size 371 */ 372 public void setSize( long size ) 373 { 374 this.size = size; 375 } //-- void setSize( long ) 376 377 /** 378 * Set true if this is a snapshot. 379 * 380 * @param snapshot 381 */ 382 public void setSnapshot( boolean snapshot ) 383 { 384 this.snapshot = snapshot; 385 } //-- void setSnapshot( boolean ) 386 387 /** 388 * Set the type of artifact. 389 * 390 * @param type 391 */ 392 public void setType( String type ) 393 { 394 this.type = type; 395 } //-- void setType( String ) 396 397 /** 398 * Set the version of the repository content. 399 * 400 * @param version 401 */ 402 public void setVersion( String version ) 403 { 404 this.version = version; 405 } //-- void setVersion( String ) 406 407 /** 408 * Set when this artifact was gathered or discovered from the 409 * repository. 410 * 411 * @param whenGathered 412 */ 413 public void setWhenGathered( java.util.Date whenGathered ) 414 { 415 this.whenGathered = whenGathered; 416 } //-- void setWhenGathered( java.util.Date ) 417 418 /** 419 * Method toString. 420 * 421 * @return String 422 */ 423 public java.lang.String toString() 424 { 425 StringBuilder buf = new StringBuilder( 128 ); 426 427 buf.append( "groupId = '" ); 428 buf.append( getGroupId() ); 429 buf.append( "'" ); 430 buf.append( "\n" ); 431 buf.append( "artifactId = '" ); 432 buf.append( getArtifactId() ); 433 buf.append( "'" ); 434 buf.append( "\n" ); 435 buf.append( "version = '" ); 436 buf.append( getVersion() ); 437 buf.append( "'" ); 438 buf.append( "\n" ); 439 buf.append( "classifier = '" ); 440 buf.append( getClassifier() ); 441 buf.append( "'" ); 442 buf.append( "\n" ); 443 buf.append( "type = '" ); 444 buf.append( getType() ); 445 buf.append( "'" ); 446 buf.append( "\n" ); 447 buf.append( "repositoryId = '" ); 448 buf.append( getRepositoryId() ); 449 buf.append( "'" ); 450 451 return buf.toString(); 452 } //-- java.lang.String toString() 453 454 455 private static final long serialVersionUID = -6292417108113887384L; 456 457 }