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

FxaDeviceSettingsCache

class FxaDeviceSettingsCache : SharedPreferencesCache<DeviceSettings> (source)

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

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

Constructors

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

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
fromJSON fun fromJSON(obj: <ERROR CLASS>): DeviceSettings
A conversion method from JSONObject to T.
toJSON fun DeviceSettings.toJSON(): <ERROR CLASS>
A conversion method from T into a JSONObject.
updateCachedName fun updateCachedName(name: String): Unit

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.