Package de.chiflux.tesla.api
Record Class TokenRefreshResponse
java.lang.Object
java.lang.Record
de.chiflux.tesla.api.TokenRefreshResponse
- Record Components:
access_token- access_tokenrefresh_token- refresh_tokenid_token- id_tokenexpires_in- expires_intoken_type- token_type
public record TokenRefreshResponse(String access_token, String refresh_token, String id_token, Integer expires_in, String token_type)
extends Record
The TokenRefreshResponse record, which encapsulates data about a refreshed token.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccess_tokenrecord component.final booleanIndicates whether some other object is "equal to" this one.longexpires()Calculates the expiration time of the access token in milliseconds.Returns the value of theexpires_inrecord component.final inthashCode()Returns a hash code value for this object.id_token()Returns the value of theid_tokenrecord component.Returns the value of therefresh_tokenrecord component.Returns the value of thetoken_typerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TokenRefreshResponse
public TokenRefreshResponse(String access_token, String refresh_token, String id_token, Integer expires_in, String token_type) Creates an instance of aTokenRefreshResponserecord class.- Parameters:
access_token- the value for theaccess_tokenrecord componentrefresh_token- the value for therefresh_tokenrecord componentid_token- the value for theid_tokenrecord componentexpires_in- the value for theexpires_inrecord componenttoken_type- the value for thetoken_typerecord component
-
-
Method Details
-
expires
public long expires()Calculates the expiration time of the access token in milliseconds.- Returns:
- The expiration time in milliseconds.
-
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
-
refresh_token
Returns the value of therefresh_tokenrecord component.- Returns:
- the value of the
refresh_tokenrecord component
-
id_token
Returns the value of theid_tokenrecord component.- Returns:
- the value of the
id_tokenrecord component
-
expires_in
Returns the value of theexpires_inrecord component.- Returns:
- the value of the
expires_inrecord component
-
token_type
Returns the value of thetoken_typerecord component.- Returns:
- the value of the
token_typerecord component
-