Package com.azure.core.credential
Class AccessToken
- java.lang.Object
-
- com.azure.core.credential.AccessToken
-
public class AccessToken extends Object
Represents an immutable access token with a token string and an expiration time.
-
-
Constructor Summary
Constructors Constructor Description AccessToken(String token, OffsetDateTime expiresAt)
Creates an access token instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OffsetDateTime
getExpiresAt()
String
getToken()
boolean
isExpired()
-
-
-
Constructor Detail
-
AccessToken
public AccessToken(String token, OffsetDateTime expiresAt)
Creates an access token instance.- Parameters:
token
- the token string.expiresAt
- the expiration time.
-
-
Method Detail
-
getToken
public String getToken()
- Returns:
- the token string.
-
getExpiresAt
public OffsetDateTime getExpiresAt()
- Returns:
- the time when the token expires, in UTC.
-
isExpired
public boolean isExpired()
- Returns:
- if the token has expired.
-
-