KeyValueStorage
interface KeyValueStorage
Content copied to clipboard
A storage for key-value pairs. Implementations can either be secure or insecure. Secure storage should store data in a secure enclave on the device. Insecure storage can save directly to disk with no need for encryption.
An insecure storage can be used for user preferences, application settings, and other inconsequential data. For more important data, like an authentication token, user identifier, the secure storage should be used. The main reason to use secure storage is to keep any third party from gaining access to the data.
Types
Functions
get
Link copied to clipboard
Gets the value stored for the given key, or returns the passed defaultValue if no value was stored for the key.
observe
Link copied to clipboard
Properties
storageSecurity
Link copied to clipboard
Inheritors
BaseKeyValueStorage
Link copied to clipboard
Extensions
property
Link copied to clipboard
fun <OWNER, T : Any> KeyValueStorage.property(key: KeyValueStorage.Key<T>): ReadWriteProperty<OWNER, T?>
Content copied to clipboard
A property delegate for the given key.
fun <OWNER, T : Any> KeyValueStorage.property(key: KeyValueStorage.Key<T>, defaultValue: T): ReadWriteProperty<OWNER, T>
Content copied to clipboard
A property delegate for the given key.