Package tech.lastbox.jwt
Record Class TokenValidation
java.lang.Object
java.lang.Record
tech.lastbox.jwt.TokenValidation
- Record Components:
tokenOptional- An optional containing the token if it is valid, or empty if invalid.isValid- A flag indicating whether the token is valid.
A record representing the validation result of a JWT (JSON Web Token).
It encapsulates the token (if valid) and a flag indicating whether the token is valid.
-
Constructor Summary
ConstructorsConstructorDescriptionTokenValidation(Optional<Token> tokenOptional, boolean isValid) Creates an instance of aTokenValidationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisValid()Returns the value of theisValidrecord component.Returns the value of thetokenOptionalrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TokenValidation
Creates an instance of aTokenValidationrecord class.- Parameters:
tokenOptional- the value for thetokenOptionalrecord componentisValid- the value for theisValidrecord component
-
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
tokenOptional
Returns the value of thetokenOptionalrecord component.- Returns:
- the value of the
tokenOptionalrecord component
-
isValid
public boolean isValid()Returns the value of theisValidrecord component.- Returns:
- the value of the
isValidrecord component
-