Browse Source

Implement equals and hashCode closes gh-18882

Signed-off-by: Andreas Asplund <andreas@asplund.biz>
pull/18969/head
Andreas Asplund 3 weeks ago committed by Josh Cummings
parent
commit
330c565178
  1. 17
      webauthn/src/main/java/org/springframework/security/web/webauthn/api/ImmutablePublicKeyCredentialUserEntity.java

17
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,22 @@ public final class ImmutablePublicKeyCredentialUserEntity implements PublicKeyCr @@ -135,6 +136,22 @@ public final class ImmutablePublicKeyCredentialUserEntity implements PublicKeyCr
return new PublicKeyCredentialUserEntityBuilder();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ImmutablePublicKeyCredentialUserEntity that)) {
return false;
}
return Objects.equals(this.name, that.name) && Objects.equals(this.id, that.id);
}
@Override
public int hashCode() {
return Objects.hash(this.name, this.id);
}
/**
* Used to build {@link PublicKeyCredentialUserEntity}.
*

Loading…
Cancel
Save