1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.compiler;
20
21 import java.util.Objects;
22 import java.util.Set;
23
24
25
26
27
28
29
30 public class DependencyCoordinate {
31 private String groupId;
32
33 private String artifactId;
34
35 private String version;
36
37 private String classifier;
38
39 private String type = "jar";
40
41 private Set<DependencyExclusion> exclusions;
42
43 public String getGroupId() {
44 return groupId;
45 }
46
47 public void setGroupId(String groupId) {
48 this.groupId = groupId;
49 }
50
51 public String getArtifactId() {
52 return artifactId;
53 }
54
55 public void setArtifactId(String artifactId) {
56 this.artifactId = artifactId;
57 }
58
59 public String getVersion() {
60 return version;
61 }
62
63 public void setVersion(String version) {
64 this.version = version;
65 }
66
67 public String getClassifier() {
68 return classifier;
69 }
70
71 public void setClassifier(String classifier) {
72 this.classifier = classifier;
73 }
74
75 public String getType() {
76 return type;
77 }
78
79 public void setType(String type) {
80 this.type = type;
81 }
82
83 public Set<DependencyExclusion> getExclusions() {
84 return exclusions;
85 }
86
87 public void setExclusions(Set<DependencyExclusion> exclusions) {
88 this.exclusions = exclusions;
89 }
90
91 @Override
92 public int hashCode() {
93 return Objects.hash(groupId, artifactId, version, classifier, type, exclusions);
94 }
95
96 @Override
97 public boolean equals(Object obj) {
98 if (this == obj) {
99 return true;
100 }
101 if (obj == null) {
102 return false;
103 }
104 if (getClass() != obj.getClass()) {
105 return false;
106 }
107 DependencyCoordinate other = (DependencyCoordinate) obj;
108 return Objects.equals(groupId, other.groupId)
109 && Objects.equals(artifactId, other.artifactId)
110 && Objects.equals(version, other.version)
111 && Objects.equals(classifier, other.classifier)
112 && Objects.equals(type, other.type)
113 && Objects.equals(exclusions, other.exclusions);
114 }
115
116 @Override
117 public String toString() {
118 return groupId + ":" + artifactId + (version != null ? ":" + version : "")
119 + (classifier != null ? ":" + classifier : "") + (type != null ? "." + type : "");
120 }
121 }