Preferences.Key
-
Cmn
class Preferences.Key<T : Any?>
Key for values stored in Preferences. Type T is the type of the value associated with the Key.
T must be one of the following: Boolean, Int, Long, Float, String, Set
Construct Keys for your data type using: booleanPreferencesKey, intPreferencesKey, longPreferencesKey, floatPreferencesKey, stringPreferencesKey, stringSetPreferencesKey, doublePreferencesKey, byteArrayPreferencesKey.
Summary
Public functions |
||
|---|---|---|
open operator Boolean |
Cmn
|
|
open Int |
hashCode() |
Cmn
|
infix Preferences.Pair<T> |
to(value: T)Infix function to create a Preferences.Pair. |
Cmn
|
open String |
toString() |
Cmn
|
Extension functions |
||
|---|---|---|
ActionParameters.Key<T> |
<T : Any> Preferences.Key<T>.toParametersKey()Creates an action key from a preferences key. |
android
|
Public functions
to
infix fun to(value: T): Preferences.Pair<T>
Infix function to create a Preferences.Pair. This is used to support preferencesOf and MutablePreferences.putAll
| Parameters | |
|---|---|
value: T |
is the value this preferences key should point to. |
Extension functions
toParametersKey
fun <T : Any> Preferences.Key<T>.toParametersKey(): ActionParameters.Key<T>
Creates an action key from a preferences key.