java.lang.Object
java.lang.Record
org.mastodon4j.core.api.entities.AccessToken
public record AccessToken(String access_token, String token_type, String scope, String created_at)
extends Record
Represents a REST access token.
-
Constructor Summary
ConstructorsConstructorDescriptionAccessToken(String access_token, String token_type, String scope, String created_at) Creates an instance of aAccessTokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccess_tokenrecord component.Returns the authorization header value.static AccessTokenCreates a new authorization token with the given bearer token string value.Returns the value of thecreated_atrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.scope()Returns the value of thescoperecord component.Returns the value of thetoken_typerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AccessToken
Creates an instance of aAccessTokenrecord class.- Parameters:
access_token- the value for theaccess_tokenrecord componenttoken_type- the value for thetoken_typerecord componentscope- the value for thescoperecord componentcreated_at- the value for thecreated_atrecord component
-
-
Method Details
-
authorization
Returns the authorization header value.- Returns:
- the authorization header
-
create
Creates a new authorization token with the given bearer token string value.- Parameters:
accessToken- the access token string- Returns:
- the authorization token instance
-
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). -
access_token
Returns the value of theaccess_tokenrecord component.- Returns:
- the value of the
access_tokenrecord component
-
token_type
Returns the value of thetoken_typerecord component.- Returns:
- the value of the
token_typerecord component
-
scope
Returns the value of thescoperecord component.- Returns:
- the value of the
scoperecord component
-
created_at
Returns the value of thecreated_atrecord component.- Returns:
- the value of the
created_atrecord component
-