Class StoredCredential
- java.lang.Object
-
- com.google.api.client.auth.oauth2.StoredCredential
-
- All Implemented Interfaces:
Serializable
@Beta public final class StoredCredential extends Object implements Serializable
Beta
Credential information to be stored in aDataStoreFactory
.Implementation is thread safe.
- Since:
- 1.16
- Author:
- Yaniv Inbar
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DATA_STORE_ID
Default data store ID.
-
Constructor Summary
Constructors Constructor Description StoredCredential()
StoredCredential(Credential credential)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
String
getAccessToken()
Returns the access token ornull
for none.static com.google.api.client.util.store.DataStore<StoredCredential>
getDefaultDataStore(com.google.api.client.util.store.DataStoreFactory dataStoreFactory)
Returns the stored credential data store using the IDDEFAULT_DATA_STORE_ID
.Long
getExpirationTimeMilliseconds()
Returns the expected expiration time in milliseconds ornull
for none.String
getRefreshToken()
Returns the refresh token ornull
for none.int
hashCode()
StoredCredential
setAccessToken(String accessToken)
Sets the access token ornull
for none.StoredCredential
setExpirationTimeMilliseconds(Long expirationTimeMilliseconds)
Sets the expected expiration time in milliseconds ornull
for none.StoredCredential
setRefreshToken(String refreshToken)
Sets the refresh token ornull
for none.String
toString()
-
-
-
Field Detail
-
DEFAULT_DATA_STORE_ID
public static final String DEFAULT_DATA_STORE_ID
Default data store ID.
-
-
Constructor Detail
-
StoredCredential
public StoredCredential()
-
StoredCredential
public StoredCredential(Credential credential)
- Parameters:
credential
- existing credential to copy from
-
-
Method Detail
-
getAccessToken
public String getAccessToken()
Returns the access token ornull
for none.
-
setAccessToken
public StoredCredential setAccessToken(String accessToken)
Sets the access token ornull
for none.
-
getExpirationTimeMilliseconds
public Long getExpirationTimeMilliseconds()
Returns the expected expiration time in milliseconds ornull
for none.
-
setExpirationTimeMilliseconds
public StoredCredential setExpirationTimeMilliseconds(Long expirationTimeMilliseconds)
Sets the expected expiration time in milliseconds ornull
for none.
-
getRefreshToken
public String getRefreshToken()
Returns the refresh token ornull
for none.
-
setRefreshToken
public StoredCredential setRefreshToken(String refreshToken)
Sets the refresh token ornull
for none.
-
getDefaultDataStore
public static com.google.api.client.util.store.DataStore<StoredCredential> getDefaultDataStore(com.google.api.client.util.store.DataStoreFactory dataStoreFactory) throws IOException
Returns the stored credential data store using the IDDEFAULT_DATA_STORE_ID
.- Parameters:
dataStoreFactory
- data store factory- Returns:
- stored credential data store
- Throws:
IOException
-
-