Preferences.Key

public final class Preferences.Key<T extends Object>


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 fields

final @NonNull String

Public methods

boolean
equals(Object other)
int
final infix @NonNull Preferences.Pair<@NonNull T>
to(T value)

Infix function to create a Preferences.Pair.

@NonNull String

Public fields

name

public final @NonNull String name

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

to

public final infix @NonNull Preferences.Pair<@NonNull T> to(T value)

Infix function to create a Preferences.Pair. This is used to support preferencesOf and MutablePreferences.putAll

Parameters
T value

is the value this preferences key should point to.

toString

public @NonNull String toString()