diff --git a/modules/gplazma2-alise/src/main/java/org/dcache/gplazma/alise/Identity.java b/modules/gplazma2-alise/src/main/java/org/dcache/gplazma/alise/Identity.java index 8e74064974c..54e82509b7f 100644 --- a/modules/gplazma2-alise/src/main/java/org/dcache/gplazma/alise/Identity.java +++ b/modules/gplazma2-alise/src/main/java/org/dcache/gplazma/alise/Identity.java @@ -18,6 +18,7 @@ */ package org.dcache.gplazma.alise; +import com.google.common.base.Objects; import java.net.URI; import static java.util.Objects.requireNonNull; @@ -40,4 +41,23 @@ public String sub() { public URI issuer() { return issuer; } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + + if (!(other instanceof Identity)) { + return false; + } + + Identity otherIdentity = (Identity)other; + return otherIdentity.sub.equals(sub) && otherIdentity.issuer.equals(issuer); + } + + @Override + public int hashCode() { + return Objects.hashCode(sub, issuer); + } }