Package land.oras.auth
Record Class HttpClient.TokenResponse
java.lang.Object
java.lang.Record
land.oras.auth.HttpClient.TokenResponse
- Record Components:
token- The tokenservice- The service (not on response but on HTTP headers)access_token- The access tokenexpires_in- The expires inissued_at- The issued at
- Enclosing class:
- HttpClient
public static record HttpClient.TokenResponse(String token, @Nullable String access_token, @Nullable String service, @Nullable Integer expires_in, @Nullable ZonedDateTime issued_at)
extends Record
The token response
-
Constructor Summary
ConstructorsConstructorDescriptionTokenResponse(String token, @Nullable String access_token, @Nullable String service, @Nullable Integer expires_in, @Nullable ZonedDateTime issued_at) Creates an instance of aTokenResponserecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the value of theaccess_tokenrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable IntegerReturns the value of theexpires_inrecord component.forService(String service) Create a new token response with the service field set>>>>>>> 6379975 (Store token into caffeine cache (#631)) Get the effective tokenfinal inthashCode()Returns a hash code value for this object.@Nullable ZonedDateTimeReturns the value of theissued_atrecord component.@Nullable Stringservice()Returns the value of theservicerecord component.token()Returns the value of thetokenrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
TokenResponse
public TokenResponse(String token, @Nullable String access_token, @Nullable String service, @Nullable Integer expires_in, @Nullable ZonedDateTime issued_at) Creates an instance of aTokenResponserecord class.- Parameters:
token- the value for thetokenrecord componentaccess_token- the value for theaccess_tokenrecord componentservice- the value for theservicerecord componentexpires_in- the value for theexpires_inrecord componentissued_at- the value for theissued_atrecord component
-
-
Method Details
-
forService
Create a new token response with the service field set- Parameters:
service- The service- Returns:
- A new token response with the service field set
-
getEffectiveToken
>>>>>>> 6379975 (Store token into caffeine cache (#631)) Get the effective token- Returns:
- The effective token, which is either the access_token or the token field depending on which one is present
-
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). -
token
Returns the value of thetokenrecord component.- Returns:
- the value of the
tokenrecord component
-
access_token
Returns the value of theaccess_tokenrecord component.- Returns:
- the value of the
access_tokenrecord component
-
service
Returns the value of theservicerecord component.- Returns:
- the value of the
servicerecord component
-
expires_in
Returns the value of theexpires_inrecord component.- Returns:
- the value of the
expires_inrecord component
-
issued_at
Returns the value of theissued_atrecord component.- Returns:
- the value of the
issued_atrecord component
-