@Beta public final class StoredCredential extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DATA_STORE_ID
Default data store ID.
|
Constructor and Description |
---|
StoredCredential() |
StoredCredential(Credential credential) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
String |
getAccessToken()
Returns the access token or
null for none. |
static DataStore<StoredCredential> |
getDefaultDataStore(DataStoreFactory dataStoreFactory)
Returns the stored credential data store using the ID
DEFAULT_DATA_STORE_ID . |
Long |
getExpirationTimeMilliseconds()
Returns the expected expiration time in milliseconds or
null for none. |
String |
getRefreshToken()
Returns the refresh token or
null for none. |
int |
hashCode() |
StoredCredential |
setAccessToken(String accessToken)
Sets the access token or
null for none. |
StoredCredential |
setExpirationTimeMilliseconds(Long expirationTimeMilliseconds)
Sets the expected expiration time in milliseconds or
null for none. |
StoredCredential |
setRefreshToken(String refreshToken)
Sets the refresh token or
null for none. |
String |
toString() |
public static final String DEFAULT_DATA_STORE_ID
public StoredCredential()
public StoredCredential(Credential credential)
credential
- existing credential to copy frompublic String getAccessToken()
null
for none.public StoredCredential setAccessToken(String accessToken)
null
for none.public Long getExpirationTimeMilliseconds()
null
for none.public StoredCredential setExpirationTimeMilliseconds(Long expirationTimeMilliseconds)
null
for none.public String getRefreshToken()
null
for none.public StoredCredential setRefreshToken(String refreshToken)
null
for none.public static DataStore<StoredCredential> getDefaultDataStore(DataStoreFactory dataStoreFactory) throws IOException
DEFAULT_DATA_STORE_ID
.dataStoreFactory
- data store factoryIOException
Copyright © 2011–2021 Google. All rights reserved.