BaseKeyValueStorage

abstract class BaseKeyValueStorage : KeyValueStorage

Functions

contains
Link copied to clipboard
abstract fun <T : Any> contains(key: KeyValueStorage.Key<T>): Boolean
Checks whether the storage contains a value with the given key.
get
Link copied to clipboard
open operator override fun <T : Any> get(key: KeyValueStorage.Key<T>): T?
Gets the value stored for the given key, or null if no value was stored for the key.
open fun <T : Any> get(key: KeyValueStorage.Key<T>, defaultValue: T): T
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
open override fun <T : Any> observe(key: KeyValueStorage.Key<T>): Flow<T?>
Observe changes to the key's value.
open fun <T : Any> observe(key: KeyValueStorage.Key<T>, defaultValue: T): Flow<T>
Observe changes to the key's value.
purge
Link copied to clipboard
abstract fun purge()
Remove all stored key-values from the storage.
set
Link copied to clipboard
open operator override fun <T : Any> set(key: KeyValueStorage.Key<T>, value: T?)
Stores the passed value for the given key.

Properties

storageSecurity
Link copied to clipboard
abstract val storageSecurity: KeyValueStorage.StorageSecurity
The security of this storage.