Skip to content

Commit 96fbffd

Browse files
committed
polish
1 parent 263b168 commit 96fbffd

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/main/java/com/jcabi/urn/URN.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import java.net.URISyntaxException;
1212
import java.net.URLDecoder;
1313
import java.util.Map;
14+
import java.util.Objects;
1415
import java.util.TreeMap;
15-
import lombok.EqualsAndHashCode;
1616
import org.apache.commons.lang3.StringUtils;
1717

1818
/**
@@ -34,7 +34,6 @@
3434
* @checkstyle AbbreviationAsWordInNameCheck (500 lines)
3535
*/
3636
@Immutable
37-
@EqualsAndHashCode
3837
@SuppressWarnings({
3938
"PMD.TooManyMethods", "PMD.UseConcurrentHashMap", "PMD.GodClass",
4039
"PMD.OnlyOneConstructorShouldDoInitialization"
@@ -153,6 +152,24 @@ public String toString() {
153152
return this.uri;
154153
}
155154

155+
@Override
156+
public boolean equals(final Object obj) {
157+
final boolean result;
158+
if (this == obj) {
159+
result = true;
160+
} else if (obj instanceof URN) {
161+
result = Objects.equals(this.uri, ((URN) obj).uri);
162+
} else {
163+
result = false;
164+
}
165+
return result;
166+
}
167+
168+
@Override
169+
public int hashCode() {
170+
return Objects.hashCode(this.uri);
171+
}
172+
156173
@Override
157174
public int compareTo(final URN urn) {
158175
return this.uri.compareTo(urn.uri);

0 commit comments

Comments
 (0)