mirror of
https://github.com/spring-projects/spring-security.git
synced 2026-03-24 11:01:09 +00:00
Implement equals and hashCode closes gh-18882
Signed-off-by: Andreas Asplund <andreas@asplund.biz>
This commit is contained in:
parent
1db0d4f83d
commit
330c565178
@ -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
|
||||
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…
x
Reference in New Issue
Block a user