public final class PreferencesKeys


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


public final PreferencesKeys()

Public methods


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.

String name

the name of the preference

@NonNull Preferences.Key<@NonNull Boolean>

the Preferences.Key for name


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