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