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