1 package org.apache.maven.plugin.compiler;
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
28 public class DependencyCoordinate
29 {
30 private String groupId;
31
32 private String artifactId;
33
34 private String version;
35
36 private String classifier;
37
38 private String type = "jar";
39
40 public String getGroupId()
41 {
42 return groupId;
43 }
44
45 public void setGroupId( String groupId )
46 {
47 this.groupId = groupId;
48 }
49
50 public String getArtifactId()
51 {
52 return artifactId;
53 }
54
55 public void setArtifactId( String artifactId )
56 {
57 this.artifactId = artifactId;
58 }
59
60 public String getVersion()
61 {
62 return version;
63 }
64
65 public void setVersion( String version )
66 {
67 this.version = version;
68 }
69
70 public String getClassifier()
71 {
72 return classifier;
73 }
74
75 public void setClassifier( String classifier )
76 {
77 this.classifier = classifier;
78 }
79
80 public String getType()
81 {
82 return type;
83 }
84
85 public void setType( String type )
86 {
87 this.type = type;
88 }
89
90 @Override
91 public int hashCode()
92 {
93 final int prime = 31;
94 int result = 1;
95 result = prime * result + ( ( artifactId == null ) ? 0 : artifactId.hashCode() );
96 result = prime * result + ( ( classifier == null ) ? 0 : classifier.hashCode() );
97 result = prime * result + ( ( groupId == null ) ? 0 : groupId.hashCode() );
98 result = prime * result + ( ( type == null ) ? 0 : type.hashCode() );
99 result = prime * result + ( ( version == null ) ? 0 : version.hashCode() );
100 return result;
101 }
102
103 @Override
104 public boolean equals( Object obj )
105 {
106 if ( this == obj )
107 {
108 return true;
109 }
110 if ( obj == null )
111 {
112 return false;
113 }
114 if ( getClass() != obj.getClass() )
115 {
116 return false;
117 }
118 DependencyCoordinate other = (DependencyCoordinate) obj;
119 if ( artifactId == null )
120 {
121 if ( other.artifactId != null )
122 {
123 return false;
124 }
125 }
126 else if ( !artifactId.equals( other.artifactId ) )
127 {
128 return false;
129 }
130 if ( classifier == null )
131 {
132 if ( other.classifier != null )
133 {
134 return false;
135 }
136 }
137 else if ( !classifier.equals( other.classifier ) )
138 {
139 return false;
140 }
141 if ( groupId == null )
142 {
143 if ( other.groupId != null )
144 {
145 return false;
146 }
147 }
148 else if ( !groupId.equals( other.groupId ) )
149 {
150 return false;
151 }
152 if ( type == null )
153 {
154 if ( other.type != null )
155 {
156 return false;
157 }
158 }
159 else if ( !type.equals( other.type ) )
160 {
161 return false;
162 }
163 if ( version == null )
164 {
165 if ( other.version != null )
166 {
167 return false;
168 }
169 }
170 else if ( !version.equals( other.version ) )
171 {
172 return false;
173 }
174 return true;
175 }
176
177 @Override
178 public String toString()
179 {
180 return groupId + ":" + artifactId + ( version != null ? ":" + version : "" )
181 + ( classifier != null ? ":" + classifier : "" ) + ( type != null ? "." + type : "" );
182 }
183 }