1 // =================== DO NOT EDIT THIS FILE ==================== 2 // Generated by Modello 1.7, 3 // any modifications will be overwritten. 4 // ============================================================== 5 6 package org.apache.archiva.configuration; 7 8 /** 9 * Class LegacyArtifactPath. 10 * 11 * @version $Revision$ $Date$ 12 */ 13 @SuppressWarnings( "all" ) 14 public class LegacyArtifactPath 15 implements java.io.Serializable 16 { 17 18 //--------------------------/ 19 //- Class/Member Variables -/ 20 //--------------------------/ 21 22 /** 23 * 24 * The legacy path. 25 * 26 */ 27 private String path; 28 29 /** 30 * 31 * The artifact reference, as " [groupId] : 32 * [artifactId] : [version] : [classifier] : [type] ". 33 * 34 */ 35 private String artifact; 36 37 38 //-----------/ 39 //- Methods -/ 40 //-----------/ 41 42 /** 43 * Get the artifact reference, as " [groupId] : [artifactId] : 44 * [version] : [classifier] : [type] ". 45 * 46 * @return String 47 */ 48 public String getArtifact() 49 { 50 return this.artifact; 51 } //-- String getArtifact() 52 53 /** 54 * Get the legacy path. 55 * 56 * @return String 57 */ 58 public String getPath() 59 { 60 return this.path; 61 } //-- String getPath() 62 63 /** 64 * Set the artifact reference, as " [groupId] : [artifactId] : 65 * [version] : [classifier] : [type] ". 66 * 67 * @param artifact 68 */ 69 public void setArtifact( String artifact ) 70 { 71 this.artifact = artifact; 72 } //-- void setArtifact( String ) 73 74 /** 75 * Set the legacy path. 76 * 77 * @param path 78 */ 79 public void setPath( String path ) 80 { 81 this.path = path; 82 } //-- void setPath( String ) 83 84 85 public boolean match( String path ) 86 { 87 return path.equals( this.path ); 88 } 89 90 public String getGroupId() 91 { 92 return artifact.split( ":" )[0]; 93 } 94 95 public String getArtifactId() 96 { 97 return artifact.split( ":" )[1]; 98 } 99 100 public String getVersion() 101 { 102 return artifact.split( ":" )[2]; 103 } 104 105 public String getClassifier() 106 { 107 String classifier = artifact.split( ":" )[3]; 108 return classifier.length() > 0 ? classifier : null; 109 } 110 111 public String getType() 112 { 113 return artifact.split( ":" )[4]; 114 } 115 116 @Override 117 public boolean equals( Object o ) 118 { 119 if ( this == o ) 120 { 121 return true; 122 } 123 if ( o == null || getClass() != o.getClass() ) 124 { 125 return false; 126 } 127 128 LegacyArtifactPath that = (LegacyArtifactPath) o; 129 130 if ( path != null ? !path.equals( that.path ) : that.path != null ) 131 { 132 return false; 133 } 134 135 return true; 136 } 137 138 @Override 139 public int hashCode() 140 { 141 return path != null ? 37 + path.hashCode() : 0; 142 } 143 144 }