android-components / mozilla.components.service.fxa / SyncAuthInfoCache

SyncAuthInfoCache

class SyncAuthInfoCache : SharedPreferencesCache<SyncAuthInfo> (source)

A thin wrapper around SharedPreferences which knows how to serialize/deserialize SyncAuthInfo.

This class exists to provide background sync workers with access to SyncAuthInfo.

Constructors

Name Summary
<init> SyncAuthInfoCache(context: <ERROR CLASS>)
A thin wrapper around SharedPreferences which knows how to serialize/deserialize SyncAuthInfo.

Properties

Name Summary
cacheKey val cacheKey: String
Name of the ‘key’ under which serialized data is stored within the cache.
cacheName val cacheName: String
Name of the cache.
logger val logger: Logger
Logger used to report issues.

Inherited Properties

Name Summary
context val context: <ERROR CLASS>

Functions

Name Summary
expired fun expired(): Boolean
fromJSON fun fromJSON(obj: <ERROR CLASS>): SyncAuthInfo
A conversion method from JSONObject to T.
toJSON fun SyncAuthInfo.toJSON(): <ERROR CLASS>
A conversion method from T into a JSONObject.

Inherited Functions

Name Summary
clear fun clear(): Unit
Clear cached values.
getCached fun getCached(): T?
setToCache fun setToCache(obj: T): Unit

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.