Package com.azure.core.credential
Class AccessToken
java.lang.Object
com.azure.core.credential.AccessToken
Represents an immutable access token with a token string and an expiration time.
-
Constructor Summary
ConstructorDescriptionAccessToken
(String token, OffsetDateTime expiresAt) Creates an access token instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the time when the token expires, in UTC.getToken()
Gets the token.boolean
Whether the token has expired.
-
Constructor Details
-
AccessToken
Creates an access token instance.- Parameters:
token
- the token string.expiresAt
- the expiration time.
-
-
Method Details
-
getToken
Gets the token.- Returns:
- The token.
-
getExpiresAt
Gets the time when the token expires, in UTC.- Returns:
- The time when the token expires, in UTC.
-
isExpired
public boolean isExpired()Whether the token has expired.- Returns:
- Whether the token has expired.
-