Package org.atmosphere.auth
Record Class TokenValidator.Valid
java.lang.Object
java.lang.Record
org.atmosphere.auth.TokenValidator.Valid
- Record Components:
principal- the authenticated identityclaims- arbitrary key-value claims extracted from the token (may be empty)
- All Implemented Interfaces:
TokenValidator.Result
- Enclosing interface:
TokenValidator
public static record TokenValidator.Valid(Principal principal, Map<String,Object> claims)
extends Record
implements TokenValidator.Result
The token is valid. Carries the authenticated principal and optional claims.
-
Constructor Summary
ConstructorsConstructorDescriptionConvenience constructor with just a name and no claims.Convenience constructor using a simple name string as the principal.Creates an instance of aValidrecord class. -
Method Summary
Modifier and TypeMethodDescriptionclaims()Returns the value of theclaimsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theprincipalrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Valid
Convenience constructor using a simple name string as the principal.- Parameters:
name- the principal nameclaims- arbitrary claims
-
Valid
Convenience constructor with just a name and no claims.- Parameters:
name- the principal name
-
Valid
Creates an instance of aValidrecord class.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
principal
Returns the value of theprincipalrecord component.- Returns:
- the value of the
principalrecord component
-
claims
Returns the value of theclaimsrecord component.- Returns:
- the value of the
claimsrecord component
-