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.


Method Index

 o getBoolean(String)
Returns the boolean value for the key.
 o getDouble(String)
Returns the double value for the key.
 o getDoubleDefault(String, double)
Same as getDouble(key) except allows a default to be returned rather than an exception if not found.
 o getFloat(String)
Returns the float value for the key.
 o getFloatDefault(String, float)
Same as getFloat(key) except allows a default to be returned rather than an exception if not found.
 o getInt(String)
Returns the int value for the key.
 o getIntDefault(String, int)
Same as getInt(key) except allows a default to be returned rather than an exception if not found.
 o getLong(String)
Returns the long value for the key.
 o getLongDefault(String, long)
Same as getLong(key) except allows a default to be returned rather than an exception if not found.
 o getString(String)
Returns the String value for the key.
 o getStringDefault(String, String)
Same as getString(key) except allows a default to be returned rather than null.
 o isFalse(String)
 o isFalseDefault(String, boolean)
Same as isFalse(key) except allows a default to be returned if not found rather than an exception.
 o isTrue(String)
 o isTrueDefault(String, boolean)
Same as isTrue(key) except allows a default to be returned if not found rather than an exception.
 o setBoolean(String, boolean)
Sets the key value, overwriting any that already exists.
 o setDouble(String, double)
Sets the key value, overwriting any that already exists.
 o setFalse(String)
Same as setBoolean(key, false).
 o setFloat(String, float)
Sets the key value, overwriting any that already exists.
 o setInt(String, int)
Sets the key value, overwriting any that already exists.
 o setLong(String, long)
Sets the key value, overwriting any that already exists.
 o setString(String, String)
Sets the key value, overwriting any that already exists.
 o setTrue(String)
Same as setBoolean(key, true).

Methods

 o 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.
 o 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.
 o 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.
 o 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.
 o setTrue
 public abstract void setTrue(String key)
Same as setBoolean(key, true).

 o setFalse
 public abstract void setFalse(String key)
Same as setBoolean(key, false).

 o 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.
 o isTrue
 public abstract boolean isTrue(String key)
 o 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.
 o isFalse
 public abstract boolean isFalse(String key)
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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