Package cdc.prefs
Interface Preference<T>
-
- Type Parameters:
T- The preference type.
- All Known Implementing Classes:
AbstractPreference,BooleanPreference,BytePreference,DatePreference,DoublePreference,EnumPreference,FilePreference,FloatPreference,IntegerPreference,LongPreference,ShortPreference,StringPreference
public interface Preference<T>Interface giving access to one (node, key) preference.- Author:
- Damien Carbonne
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Tget()Tget(T def)Returns the value associated to this (node, key).TgetDefaultValue()StringgetKey()PreferencesgetNode()Class<T>getValueClass()voidput(T value)Puts a value into this (node, key).
-
-
-
Method Detail
-
getNode
Preferences getNode()
- Returns:
- The associated node.
-
getKey
String getKey()
- Returns:
- The associated key.
-
getDefaultValue
T getDefaultValue()
- Returns:
- The default value.
-
put
void put(T value)
Puts a value into this (node, key).- Parameters:
value- The value.
-
get
T get(T def)
Returns the value associated to this (node, key).- Parameters:
def- The default value to return when there is no associated value or value processing raises an exception- Returns:
- The associated value or
def.
-
get
default T get()
- Returns:
- the value associated to this (node, key) or the default value.
-
-