From: David ‘Bombe’ Roden Date: Fri, 12 Jun 2009 19:46:23 +0000 (+0200) Subject: Override equals() and hashCode() in Identity. X-Git-Tag: v0.1.1~27 X-Git-Url: https://git.pterodactylus.net/?p=jFCPlib.git;a=commitdiff_plain;h=edbcd819855c6dc4d9bbe329120b6adbf6f376ca Override equals() and hashCode() in Identity. --- diff --git a/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java b/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java index f265855..1649ce8 100644 --- a/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java +++ b/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java @@ -489,6 +489,26 @@ public class WebOfTrustPlugin { return requestUri; } + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if ((obj == null) || (obj.getClass() != this.getClass())) { + return false; + } + Identity identity = (Identity) obj; + return identifier.equals(identity.identifier); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return identifier.hashCode(); + } + } /**