Record Class OAuth2Handler.AccessTokenResponse
java.lang.Object
java.lang.Record
com.mastercard.developer.oauth2.core.OAuth2Handler.AccessTokenResponse
- Enclosing class:
- OAuth2Handler
public static record OAuth2Handler.AccessTokenResponse(String tokenValue, Set<String> scopes, Instant expiry)
extends Record
Model for the response from an OAuth2 token endpoint.
See: RFC 6749 Section 5.1
-
Constructor Summary
ConstructorsConstructorDescriptionAccessTokenResponse(String tokenValue, Set<String> scopes, Instant expiry) Creates an instance of aAccessTokenResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.expiry()Returns the value of theexpiryrecord component.final inthashCode()Returns a hash code value for this object.scopes()Returns the value of thescopesrecord component.Returns the value of thetokenValuerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AccessTokenResponse
Creates an instance of aAccessTokenResponserecord class.- Parameters:
tokenValue- the value for thetokenValuerecord componentscopes- the value for thescopesrecord componentexpiry- the value for theexpiryrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
tokenValue
Returns the value of thetokenValuerecord component.- Returns:
- the value of the
tokenValuerecord component
-
scopes
Returns the value of thescopesrecord component.- Returns:
- the value of the
scopesrecord component
-
expiry
Returns the value of theexpiryrecord component.- Returns:
- the value of the
expiryrecord component
-