1 package org.eclipse.aether.graph;
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 public final class Exclusion
28 {
29
30 private final String groupId;
31
32 private final String artifactId;
33
34 private final String classifier;
35
36 private final String extension;
37
38
39
40
41
42
43
44
45
46 public Exclusion( String groupId, String artifactId, String classifier, String extension )
47 {
48 this.groupId = ( groupId != null ) ? groupId : "";
49 this.artifactId = ( artifactId != null ) ? artifactId : "";
50 this.classifier = ( classifier != null ) ? classifier : "";
51 this.extension = ( extension != null ) ? extension : "";
52 }
53
54
55
56
57
58
59 public String getGroupId()
60 {
61 return groupId;
62 }
63
64
65
66
67
68
69 public String getArtifactId()
70 {
71 return artifactId;
72 }
73
74
75
76
77
78
79 public String getClassifier()
80 {
81 return classifier;
82 }
83
84
85
86
87
88
89 public String getExtension()
90 {
91 return extension;
92 }
93
94 @Override
95 public String toString()
96 {
97 return getGroupId() + ':' + getArtifactId() + ':' + getExtension()
98 + ( getClassifier().length() > 0 ? ':' + getClassifier() : "" );
99 }
100
101 @Override
102 public boolean equals( Object obj )
103 {
104 if ( obj == this )
105 {
106 return true;
107 }
108 else if ( obj == null || !getClass().equals( obj.getClass() ) )
109 {
110 return false;
111 }
112
113 Exclusion that = (Exclusion) obj;
114
115 return artifactId.equals( that.artifactId ) && groupId.equals( that.groupId )
116 && extension.equals( that.extension ) && classifier.equals( that.classifier );
117 }
118
119 @Override
120 public int hashCode()
121 {
122 int hash = 17;
123 hash = hash * 31 + artifactId.hashCode();
124 hash = hash * 31 + groupId.hashCode();
125 hash = hash * 31 + classifier.hashCode();
126 hash = hash * 31 + extension.hashCode();
127 return hash;
128 }
129
130 }