Class StoredCredential (1.36.0)

public final class StoredCredential implements Serializable

Beta
Credential information to be stored in a DataStoreFactory.

Implementation is thread safe.

Inheritance

Object > StoredCredential

Implements

Serializable

Static Fields

DEFAULT_DATA_STORE_ID

public static final String DEFAULT_DATA_STORE_ID

Default data store ID.

Field Value
Type Description
String

Static Methods

getDefaultDataStore(DataStoreFactory dataStoreFactory)

public static DataStore<StoredCredential> getDefaultDataStore(DataStoreFactory dataStoreFactory)

Returns the stored credential data store using the ID #DEFAULT_DATA_STORE_ID.

Parameter
Name Description
dataStoreFactory com.google.api.client.util.store.DataStoreFactory

data store factory

Returns
Type Description
com.google.api.client.util.store.DataStore<StoredCredential>

stored credential data store

Exceptions
Type Description
IOException

Constructors

StoredCredential()

public StoredCredential()

StoredCredential(Credential credential)

public StoredCredential(Credential credential)
Parameter
Name Description
credential Credential

existing credential to copy from

Methods

equals(Object other)

public boolean equals(Object other)
Parameter
Name Description
other Object
Returns
Type Description
boolean
Overrides

getAccessToken()

public String getAccessToken()

Returns the access token or null for none.

Returns
Type Description
String

getExpirationTimeMilliseconds()

public Long getExpirationTimeMilliseconds()

Returns the expected expiration time in milliseconds or null for none.

Returns
Type Description
Long

getRefreshToken()

public String getRefreshToken()

Returns the refresh token or null for none.

Returns
Type Description
String

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

setAccessToken(String accessToken)

public StoredCredential setAccessToken(String accessToken)

Sets the access token or null for none.

Parameter
Name Description
accessToken String
Returns
Type Description
StoredCredential

setExpirationTimeMilliseconds(Long expirationTimeMilliseconds)

public StoredCredential setExpirationTimeMilliseconds(Long expirationTimeMilliseconds)

Sets the expected expiration time in milliseconds or null for none.

Parameter
Name Description
expirationTimeMilliseconds Long
Returns
Type Description
StoredCredential

setRefreshToken(String refreshToken)

public StoredCredential setRefreshToken(String refreshToken)

Sets the refresh token or null for none.

Parameter
Name Description
refreshToken String
Returns
Type Description
StoredCredential

toString()

public String toString()
Returns
Type Description
String
Overrides