PreferencesKeys

public final class PreferencesKeys


Summary

Public constructors

Public methods

static final @NonNull Preferences.Key<@NonNull Boolean>

Get a key for a Boolean preference.

static final @NonNull Preferences.Key<@NonNull Double>

Get a key for a Double preference.

static final @NonNull Preferences.Key<@NonNull Float>

Get a key for a Float preference.

static final @NonNull Preferences.Key<@NonNull Integer>
intKey(String name)

Get a key for an Int preference.

static final @NonNull Preferences.Key<@NonNull Long>

Get a key for an Long preference.

static final @NonNull Preferences.Key<@NonNull String>

Get a key for a String preference.

static final @NonNull Preferences.Key<@NonNull Set<@NonNull String>>

Get a key for a String Set preference.

Public constructors

PreferencesKeys

public final PreferencesKeys()

Public methods

booleanKey

public static final @NonNull Preferences.Key<@NonNull BooleanbooleanKey(String name)

Get a key for a Boolean preference. You should not have multiple keys with the same name (for use with the same Preferences). Using overlapping keys with different types can result in ClassCastException.

Parameters
String name

the name of the preference

Returns
@NonNull Preferences.Key<@NonNull Boolean>

the Preferences.Key for name

doubleKey

public static final @NonNull Preferences.Key<@NonNull Double