Class StoredCredential (1.32.1)

public final class StoredCredential implements Serializable

Beta
Credential information to be stored in a DataStoreFactory.

Implementation is thread safe.

Inheritance

Object > StoredCredential

Implements

Serializable

Constructors

StoredCredential()

public StoredCredential()

StoredCredential(Credential credential)

public StoredCredential(Credential credential)
Parameter
NameDescription
credentialCredential

existing credential to copy from

Fields

DEFAULT_DATA_STORE_ID

public static final String DEFAULT_DATA_STORE_ID

Default data store ID.

Field Value
TypeDescription
String

Methods

equals(Object other)

public boolean equals(Object other)
Parameter
NameDescription
otherObject
Returns
TypeDescription
boolean
Overrides

getAccessToken()

public String getAccessToken()

Returns the access token or null for none.

Returns
TypeDescription
String

getDefaultDataStore(DataStoreFactory dataStoreFactory)

public static DataStore<StoredCredential> getDefaultDataStore(DataStoreFactory dataStoreFactory)

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

Parameter
NameDescription
dataStoreFactorycom.google.api.client.util.store.DataStoreFactory

data store factory

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

stored credential data store

Exceptions
TypeDescription
IOException

getExpirationTimeMilliseconds()

public Long getExpirationTimeMilliseconds()

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

Returns
TypeDescription
Long

getRefreshToken()

public String getRefreshToken()

Returns the refresh token or null for none.

Returns
TypeDescription
String

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

setAccessToken(String accessToken)

public StoredCredential setAccessToken(String accessToken)

Sets the access token or null for none.

Parameter
NameDescription
accessTokenString
Returns
TypeDescription
StoredCredential

setExpirationTimeMilliseconds(Long expirationTimeMilliseconds)

public StoredCredential setExpirationTimeMilliseconds(Long expirationTimeMilliseconds)

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

Parameter
NameDescription
expirationTimeMillisecondsLong
Returns
TypeDescription
StoredCredential

setRefreshToken(String refreshToken)

public StoredCredential setRefreshToken(String refreshToken)

Sets the refresh token or null for none.

Parameter
NameDescription
refreshTokenString
Returns
TypeDescription
StoredCredential

toString()

public String toString()
Returns
TypeDescription
String
Overrides