All Packages Class Hierarchy This Package Previous Next Index
Interface uhr.core.tron.ConvenientStringMap
- public interface ConvenientStringMap
This interface contains convenience methods for use in
collections that have String keys and Object values.
This improves understandability and reduces code bloat.
-
getBoolean(String)
- Returns the boolean value for the key.
-
getDouble(String)
- Returns the double value for the key.
-
getDoubleDefault(String,
double)
- Same as getDouble(key) except allows a default to be
returned rather than an exception if not found.
-
getFloat(String)
- Returns the float value for the key.
-
getFloatDefault(String,
float)
- Same as getFloat(key) except allows a default to be
returned rather than an exception if not found.
-
getInt(String)
- Returns the int value for the key.
-
getIntDefault(String,
int)
- Same as getInt(key) except allows a default to be
returned rather than an exception if not found.
-
getLong(String)
- Returns the long value for the key.
-
getLongDefault(String,
long)
- Same as getLong(key) except allows a default to be
returned rather than an exception if not found.
-
getString(String)
- Returns the String value for the key.
-
getStringDefault(String,
String)
- Same as getString(key) except allows a default to be
returned rather than null.
-
isFalse(String)
-
-
isFalseDefault(String,
boolean)
- Same as isFalse(key) except allows a default to be
returned if not found rather than an exception.
-
isTrue(String)
-
-
isTrueDefault(String,
boolean)
- Same as isTrue(key) except allows a default to be
returned if not found rather than an exception.
-
setBoolean(String,
boolean)
- Sets the key value, overwriting any that already exists.
-
setDouble(String,
double)
- Sets the key value, overwriting any that already exists.
-
setFalse(String)
- Same as setBoolean(key, false).
-
setFloat(String,
float)
- Sets the key value, overwriting any that already exists.
-
setInt(String,
int)
- Sets the key value, overwriting any that already exists.
-
setLong(String,
long)
- Sets the key value, overwriting any that already exists.
-
setString(String,
String)
- Sets the key value, overwriting any that already exists.
-
setTrue(String)
- Same as setBoolean(key, true).
setString
public abstract void setString(String key,
String value)
- Sets the key value, overwriting any that already exists.
- Parameters:
- key - the unique key, which may not be null.
- value - the String value, which may be null.
getString
public abstract String getString(String key)
- Returns the String value for the key.
- Parameters:
- key - the key to be used for the lookup.
- Returns:
- the key's value or null.
getStringDefault
public abstract String getStringDefault(String key,
String defaultValue)
- Same as getString(key) except allows a default to be
returned rather than null.
- Parameters:
- key - the key to be used for the lookup.
- defaultValue - the default to be used if the
return would otherwise be null.
- Returns:
- the key's value or the defaultValue if not found.
setBoolean
public abstract void setBoolean(String key,
boolean value)
- Sets the key value, overwriting any that already exists.
- Parameters:
- key - the unique key, which may not be null.
- value - the boolean value.
setTrue
public abstract void setTrue(String key)
- Same as setBoolean(key, true).
setFalse
public abstract void setFalse(String key)
- Same as setBoolean(key, false).
getBoolean
public abstract boolean getBoolean(String key)
- Returns the boolean value for the key.
- Parameters:
- key - the key to be used for the lookup.
- Returns:
- the key's value or an exception if not found.
isTrue
public abstract boolean isTrue(String key)
isTrueDefault
public abstract boolean isTrueDefault(String key,
boolean defaultValue)
- Same as isTrue(key) except allows a default to be
returned if not found rather than an exception.
- Parameters:
- key - the key to be used for the lookup.
- defaultValue - the default to be used if the
value is not found.
- Returns:
- true if the key's value is true, false if
it's false, or the defaultValue if not found.
isFalse
public abstract boolean isFalse(String key)
isFalseDefault
public abstract boolean isFalseDefault(String key,
boolean defaultValue)
- Same as isFalse(key) except allows a default to be
returned if not found rather than an exception.
- Parameters:
- key - the key to be used for the lookup.
- defaultValue - the default to be used if the
value is not found.
- Returns:
- true if the key's value is false, false if
it's true, or the defaultValue if not found.
setInt
public abstract void setInt(String key,
int value)
- Sets the key value, overwriting any that already exists.
- Parameters:
- key - the unique key, which may not be null.
- value - the int value.
getInt
public abstract int getInt(String key)
- Returns the int value for the key.
- Parameters:
- key - the key to be used for the lookup.
- Returns:
- the key's value or an exception if not found.
getIntDefault
public abstract int getIntDefault(String key,
int defaultValue)
- Same as getInt(key) except allows a default to be
returned rather than an exception if not found.
- Parameters:
- key - the key to be used for the lookup.
- defaultValue - the default to be used if not found.
- Returns:
- the key's value or the defaultValue if not found.
setLong
public abstract void setLong(String key,
long value)
- Sets the key value, overwriting any that already exists.
- Parameters:
- key - the unique key, which may not be null.
- value - the long value.
getLong
public abstract long getLong(String key)
- Returns the long value for the key.
- Parameters:
- key - the key to be used for the lookup.
- Returns:
- the key's value or an exception if not found.
getLongDefault
public abstract long getLongDefault(String key,
long defaultValue)
- Same as getLong(key) except allows a default to be
returned rather than an exception if not found.
- Parameters:
- key - the key to be used for the lookup.
- defaultValue - the default to be used if not found.
- Returns:
- the key's value or the defaultValue if not found.
setFloat
public abstract void setFloat(String key,
float value)
- Sets the key value, overwriting any that already exists.
- Parameters:
- key - the unique key, which may not be null.
- value - the float value.
getFloat
public abstract float getFloat(String key)
- Returns the float value for the key.
- Parameters:
- key - the key to be used for the lookup.
- Returns:
- the key's value or an exception if not found.
getFloatDefault
public abstract float getFloatDefault(String key,
float defaultValue)
- Same as getFloat(key) except allows a default to be
returned rather than an exception if not found.
- Parameters:
- key - the key to be used for the lookup.
- defaultValue - the default to be used if not found.
- Returns:
- the key's value or the defaultValue if not found.
setDouble
public abstract void setDouble(String key,
double value)
- Sets the key value, overwriting any that already exists.
- Parameters:
- key - the unique key, which may not be null.
- value - the double value.
getDouble
public abstract double getDouble(String key)
- Returns the double value for the key.
- Parameters:
- key - the key to be used for the lookup.
- Returns:
- the key's value or an exception if not found.
getDoubleDefault
public abstract double getDoubleDefault(String key,
double defaultValue)
- Same as getDouble(key) except allows a default to be
returned rather than an exception if not found.
- Parameters:
- key - the key to be used for the lookup.
- defaultValue - the default to be used if not found.
- Returns:
- the key's value or the defaultValue if not found.
All Packages Class Hierarchy This Package Previous Next Index