Override equals() and hashCode() in Identity.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 12 Jun 2009 19:46:23 +0000 (21:46 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 12 Jun 2009 19:46:23 +0000 (21:46 +0200)
src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java

index f265855..1649ce8 100644 (file)
@@ -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();
+               }
+
        }
 
        /**