Key

interface Key<T : Any>

Storage key is used to retrieve and store data in the storage. Implement this interface for each piece of data you want to store in either secure or insecure storage. The key itself has zero notion of where the data is stored.

Example

object AppStartCounterKey: Key<Int> {
override val key = "AppStartCounterKey"
override val serializer = Int.serializer()
}

Properties

key
Link copied to clipboard
open val key: String
The key used by the storage implementation to bind the value to it.
serializer
Link copied to clipboard
abstract val serializer: KSerializer<T>
Serializer for the value.