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 methods

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

Infix function to create a Preferences.Pair.

@NonNull String

Public methods

equals

public boolean equals(Object other)

getName

Added in 1.0.0
public final @NonNull String getName()

hashCode

public int hashCode()

to

Added in 1.0.0
public final @NonNull 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

public @NonNull String toString()