SettingsService

Platform independent settings service. Settings service is a key/value storage (persistent or non persistent), that also allows to register observers to get notifications when values are updated.

Functions

Link copied to clipboard
@MainThread
open fun erase(key: String): Expected<String, None>
Erase value for the specified key.
Link copied to clipboard
@MainThread
open fun get(key: String): Expected<String, Value>
Get value for the specified key.
@MainThread
open fun get(key: String, defaultValue: Value): Expected<String, Value>
Get value for the specified key, if key doesn't exist return a default value.
Link copied to clipboard
@MainThread
open fun has(key: String): Expected<String, Boolean>
Check if provided key exists in the storage.
Link copied to clipboard
@RestrictTo(value = Scope.LIBRARY_GROUP_PREFIX)
@MainThread
open fun registerObserver(key: String, observer: OnValueChanged): Int
WARNING: This API is not intended for public usage.
Link copied to clipboard
@RestrictTo(value = Scope.LIBRARY_GROUP_PREFIX)
@MainThread
open fun registerObserverAtSettingsThread(key: String, observer: OnValueChanged): Int
WARNING: This API is not intended for public usage.
Link copied to clipboard
@MainThread
open fun set(key: String, value: Value): Expected<String, None>
Set value for the specified key.
Link copied to clipboard
@MainThread
open fun setFromFile(filePath: String): Expected<String, None>
Set multiple settings from a JSON file.
Link copied to clipboard
@MainThread
open fun setIfAbsent(key: String, value: Value): Expected<String, Value>
Set value for the specified key only if there is no value available for specified key.
Link copied to clipboard
@RestrictTo(value = Scope.LIBRARY_GROUP_PREFIX)
@MainThread
open fun unregisterObserver(observerId: Int)
WARNING: This API is not intended for public usage.