Browse Source

Implement equals and hashCode closes gh-18882

Signed-off-by: Andreas Asplund <andreas@asplund.biz>
pull/18883/head
Andreas Asplund 1 week ago
parent
commit
fa9caf434e
No known key found for this signature in database
  1. 14
      webauthn/src/main/java/org/springframework/security/web/webauthn/api/ImmutablePublicKeyCredentialUserEntity.java

14
webauthn/src/main/java/org/springframework/security/web/webauthn/api/ImmutablePublicKeyCredentialUserEntity.java

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
package org.springframework.security.web.webauthn.api;
import java.io.Serial;
import java.util.Objects;
import org.jspecify.annotations.Nullable;
@ -135,6 +136,19 @@ public final class ImmutablePublicKeyCredentialUserEntity implements PublicKeyCr @@ -135,6 +136,19 @@ public final class ImmutablePublicKeyCredentialUserEntity implements PublicKeyCr
return new PublicKeyCredentialUserEntityBuilder();
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ImmutablePublicKeyCredentialUserEntity that)) {
return false;
}
return Objects.equals(getName(), that.getName()) && Objects.equals(getId(), that.getId());
}
@Override
public int hashCode() {
return Objects.hash(getName(), getId());
}
/**
* Used to build {@link PublicKeyCredentialUserEntity}.
*

Loading…
Cancel
Save