|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.aludratest.config.impl.AbstractPreferences
public abstract class AbstractPreferences
Abstract base implementation of the Preferences
interface. All getters are implemented and perform conversions from
String to required type. The String getter deals with complex key names (containing slashes for subnode access), with variable
references, and eventually redirects to an abstract method internalGetStringValue(String)
, which only has to deal with
a given configuration key simple name.
Constructor Summary | |
---|---|
AbstractPreferences()
|
Method Summary | |
---|---|
boolean |
getBooleanValue(String key)
Returns the boolean representation of the given configuration key's value. |
boolean |
getBooleanValue(String key,
boolean defaultValue)
Returns the boolean representation of the given configuration key's value, or the given default value when no value is stored for this key, or the stored String form of the value is null . |
char |
getCharValue(String key)
Returns the char representation of the given configuration key's value. |
char |
getCharValue(String key,
char defaultValue)
Returns the char representation of the given configuration key's value, or the given default value when no value is stored for this key, or the stored String form of the value is null . |
double |
getDoubleValue(String key)
Returns the double representation of the given configuration key's value. |
double |
getDoubleValue(String key,
double defaultValue)
Returns the double representation of the given configuration key's value, or the given default value when no value is stored for this key, or the stored String form of the value is null . |
float |
getFloatValue(String key)
Returns the float representation of the given configuration key's value. |
float |
getFloatValue(String key,
float defaultValue)
Returns the float representation of the given configuration key's value, or the given default value when no value is stored for this key, or the stored String form of the value is null . |
int |
getIntValue(String key)
Returns the int representation of the given configuration key's value. |
int |
getIntValue(String key,
int defaultValue)
Returns the int representation of the given configuration key's value, or the given default value when no value is stored for this key, or the stored String form of the value is null . |
String |
getStringValue(String key)
Returns the String representation of the given configuration key's value. |
String |
getStringValue(String key,
String defaultValue)
Returns the String representation of the given configuration key's value, or the given default value when no value is stored for this key, or the stored value is null . |
protected abstract String |
internalGetStringValue(String key)
Performs the actual task of retrieving the plain stored value for a given key on this Preferences node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.aludratest.config.Preferences |
---|
getChildNode, getChildNodeNames, getKeyNames |
Constructor Detail |
---|
public AbstractPreferences()
Method Detail |
---|
protected abstract String internalGetStringValue(String key)
key
- Configuration key to retrieve the value of.
public final String getStringValue(String key)
Preferences
getStringValue
in interface Preferences
key
- Configuration key to retrieve the value of.
null
is returned if no value is stored.public final int getIntValue(String key, int defaultValue)
Preferences
null
.
getIntValue
in interface Preferences
key
- Configuration key to retrieve the value of.defaultValue
- The default value to return if no value is stored for the given configuration key, or if the stored String form
of the value is null
.
public final boolean getBooleanValue(String key, boolean defaultValue)
Preferences
null
.
getBooleanValue
in interface Preferences
key
- Configuration key to retrieve the value of.defaultValue
- The default value to return if no value is stored for the given configuration key, or if the stored String form
of the value is null
.
public final float getFloatValue(String key, float defaultValue)
Preferences
null
.
getFloatValue
in interface Preferences
key
- Configuration key to retrieve the value of.defaultValue
- The default value to return if no value is stored for the given configuration key, or if the stored String form
of the value is null
.
public final double getDoubleValue(String key, double defaultValue)
Preferences
null
.
getDoubleValue
in interface Preferences
key
- Configuration key to retrieve the value of.defaultValue
- The default value to return if no value is stored for the given configuration key, or if the stored String form
of the value is null
.
public final char getCharValue(String key, char defaultValue)
Preferences
null
.
getCharValue
in interface Preferences
key
- Configuration key to retrieve the value of.defaultValue
- The default value to return if no value is stored for the given configuration key, or if the stored String form
of the value is null
.
public String getStringValue(String key, String defaultValue)
Preferences
null
.
getStringValue
in interface Preferences
key
- Configuration key to retrieve the value of.defaultValue
- The default value to return if no value is stored for the given configuration key, or the stored value is
null
.
public int getIntValue(String key)
Preferences
getIntValue
in interface Preferences
key
- Configuration key to retrieve the value of.
0
is returned if no value is stored, or the stored
String is null
.public float getFloatValue(String key)
Preferences
getFloatValue
in interface Preferences
key
- Configuration key to retrieve the value of.
0
is returned if no value is stored, or the stored
String is null
.public boolean getBooleanValue(String key)
Preferences
getBooleanValue
in interface Preferences
key
- Configuration key to retrieve the value of.
false
is returned if no value is stored, or the
stored String is null
.public char getCharValue(String key)
Preferences
getCharValue
in interface Preferences
key
- Configuration key to retrieve the value of.
'\0'
is returned if no value is stored, or the stored
String is null
. If a longer String is stored, only the first character is returned.public double getDoubleValue(String key)
Preferences
getDoubleValue
in interface Preferences
key
- Configuration key to retrieve the value of.
0
is returned if no value is stored, or the stored
String is null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |