Skip to content

Commit 6c58de3

Browse files
mrtssvenzik
authored andcommitted
Override equals() and hashCode() in WebEidAuthentication
WE2-860 Signed-off-by: Mart Somermaa <[email protected]>
1 parent 2328272 commit 6c58de3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

example/src/main/java/eu/webeid/example/security/WebEidAuthentication.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,15 @@ private static String getPrincipalNameFromCertificate(X509Certificate userCertif
6161
}
6262
}
6363

64+
@Override
65+
public boolean equals(Object o) {
66+
if (!super.equals(o)) return false;
67+
WebEidAuthentication that = (WebEidAuthentication) o;
68+
return Objects.equals(idCode, that.idCode);
69+
}
70+
71+
@Override
72+
public int hashCode() {
73+
return Objects.hash(super.hashCode(), idCode);
74+
}
6475
}

0 commit comments

Comments
 (0)