- java.lang.Object
-
- de.carne.util.prefs.Preference<@NonNull java.lang.Long>
-
- de.carne.util.prefs.LongPreference
-
public class LongPreference extends Preference<@NonNull java.lang.Long>
Long preference access.
-
-
Constructor Summary
Constructors Constructor Description LongPreference(java.lang.String key, long defaultValue)Constructs a new LongPreference instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Longget(java.util.prefs.Preferences prefs, java.lang.Long def)Gets this instance's preference value.longgetLong(java.util.prefs.Preferences prefs)Gets this instance's preference value.longgetLong(java.util.prefs.Preferences prefs, long def)Gets this instance's preference value.voidput(java.util.prefs.Preferences prefs, java.lang.Long value)Sets this instance's preference value.voidputLong(java.util.prefs.Preferences prefs, long value)Sets this instance's preference value.-
Methods inherited from class de.carne.util.prefs.Preference
defaultValue, get, key, remove
-
-
-
-
Constructor Detail
-
LongPreference
public LongPreference(java.lang.String key, long defaultValue)Constructs a new LongPreference instance.- Parameters:
key- the preference key to access.defaultValue- the default preference value to use.
-
-
Method Detail
-
get
public java.lang.Long get(java.util.prefs.Preferences prefs, java.lang.Long def)Description copied from class:PreferenceGets this instance's preference value.- Specified by:
getin classPreference<@NonNull java.lang.Long>- Parameters:
prefs- the Preferences object to get the value from.def- the default preference value to return in case the preference is not defined.- Returns:
- the retrieved preference value.
-
put
public void put(java.util.prefs.Preferences prefs, java.lang.Long value)Description copied from class:PreferenceSets this instance's preference value.- Specified by:
putin classPreference<@NonNull java.lang.Long>- Parameters:
prefs- the Preferences object to set the value into.value- the preference value to set.
-
getLong
public long getLong(java.util.prefs.Preferences prefs)
Gets this instance's preference value.- Parameters:
prefs- the Preferences object to get the value from.- Returns:
- the retrieved preference value.
-
getLong
public long getLong(java.util.prefs.Preferences prefs, long def)Gets this instance's preference value.- Parameters:
prefs- the Preferences object to get the value from.def- the default preference value to return in case the preference is not defined.- Returns:
- the retrieved preference value.
-
putLong
public void putLong(java.util.prefs.Preferences prefs, long value)Sets this instance's preference value.- Parameters:
prefs- the Preferences object to set the value longo.value- the preference value to set.
-
-