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
int
infix final @NonNull Preferences.Pair<@NonNull T>
to(@NonNull T value)

Infix function to create a Preferences.Pair.

@NonNull String

Public fields

name

@NonNull
public final @NonNull String name

Public methods

equals

@NonNull
public boolean equals(@Nullable Object other)

hashCode

@NonNull
public int hashCode()

to

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

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

Parameters
@NonNull T value

is the value this preferences key should point to.

toString

@NonNull
public String toString()