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

Summary

Public functions

open operator Boolean
equals(other: Any?)
open Int
infix Preferences.Pair<T>
to(value: T)

Infix function to create a Preferences.Pair.

open String

Public properties

String

Extension functions

ActionParameters.Key<T>

Creates an action key from a preferences key.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

to

Added in 1.0.0
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.

toString

open fun toString(): String

Public properties

name

Added in 1.0.0
val nameString

Extension functions

toParametersKey

fun <T : Any> Preferences.Key<T>.toParametersKey(): ActionParameters.Key<T>

Creates an action key from a preferences key.