1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.aether.graph;
20
21
22
23
24
25
26 public final class Exclusion {
27
28 private final String groupId;
29
30 private final String artifactId;
31
32 private final String classifier;
33
34 private final String extension;
35
36
37
38
39
40
41
42
43
44 public Exclusion(String groupId, String artifactId, String classifier, String extension) {
45 this.groupId = (groupId != null) ? groupId : "";
46 this.artifactId = (artifactId != null) ? artifactId : "";
47 this.classifier = (classifier != null) ? classifier : "";
48 this.extension = (extension != null) ? extension : "";
49 }
50
51
52
53
54
55
56 public String getGroupId() {
57 return groupId;
58 }
59
60
61
62
63
64
65 public String getArtifactId() {
66 return artifactId;
67 }
68
69
70
71
72
73
74 public String getClassifier() {
75 return classifier;
76 }
77
78
79
80
81
82
83 public String getExtension() {
84 return extension;
85 }
86
87 @Override
88 public String toString() {
89 return getGroupId()
90 + ':'
91 + getArtifactId()
92 + ':'
93 + getExtension()
94 + (!getClassifier().isEmpty() ? ':' + getClassifier() : "");
95 }
96
97 @Override
98 public boolean equals(Object obj) {
99 if (obj == this) {
100 return true;
101 } else if (obj == null || !getClass().equals(obj.getClass())) {
102 return false;
103 }
104
105 Exclusion that = (Exclusion) obj;
106
107 return artifactId.equals(that.artifactId)
108 && groupId.equals(that.groupId)
109 && extension.equals(that.extension)
110 && classifier.equals(that.classifier);
111 }
112
113 @Override
114 public int hashCode() {
115 int hash = 17;
116 hash = hash * 31 + artifactId.hashCode();
117 hash = hash * 31 + groupId.hashCode();
118 hash = hash * 31 + classifier.hashCode();
119 hash = hash * 31 + extension.hashCode();
120 return hash;
121 }
122 }