Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ public Map<String, Object> getClaims() {
return this.claims;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think pattern matching can be applied here

if (obj instanceof OidcIdToken that) {
	return this.claims.equals(that.claims);
}

return false;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's any point in that. You can implement the method in different ways, but make it perform the same task. I copied and polished these methods from a neighboring class, so I don't think anything needs to be changed.

return true;
}
if (obj == null || this.getClass() != obj.getClass()) {
return false;
}
OidcIdToken that = (OidcIdToken) obj;
return this.getClaims().equals(that.getClaims());
}

@Override
public int hashCode() {
return this.getClaims().hashCode();
}

/**
* Create a {@link Builder} based on the given token value
* @param tokenValue the token value to use
Expand Down