public class ParameterMap extends TreeMap<String,Object>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
ParameterMap() |
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(String key,
boolean defaultValue)
Checks if a
Boolean object is stored under the specified key. |
double |
getDouble(String key,
double defaultValue)
Checks if a
Double object is stored under the specified key.If the stored object has another numeric type,
it is converted to double . |
File |
getFile(String key)
Checks if a
File object is stored under the specified key. |
File |
getFile(String key,
File defaultValue)
Checks if a
File object is stored under the specified key. |
float |
getFloat(String key,
float defaultValue)
Checks if a
Float object is stored under the specified key. |
int |
getInteger(String key,
int defaultValue)
Checks if a
Integer object is stored under the specified key. |
long |
getLong(String key,
long defaultValue)
Checks if a
Long object is stored under the specified key. |
Object |
getObject(String key,
Object defaultValue)
Returns the stored object for the key or
defaultValue if no object is found. |
String |
getString(String key)
Checks if an object is stored under the specified key.
|
String |
getString(String key,
String defaultValue)
Checks if an object is stored under the specified key.
|
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, size, subMap, subMap, tailMap, tailMap, values
equals, hashCode, isEmpty, toString
public ParameterMap()
public String getString(String key, String defaultValue)
Object.toString()
is
returned, otherwise defaultValue
is returned.key
- the key under which the result is storeddefaultValue
- the value to be returned, if no appropriate object is founddefaultValue
public String getString(String key)
Object.toString()
is
returned, otherwise null
is returned.key
- the key under which the result is storednull
public float getFloat(String key, float defaultValue)
Float
object is stored under the specified key. (Objects of the types Integer
or
Long
are converted.) If the stored object has another type or no object is found,
defaultValue
is returned.key
- the key under which the result is storeddefaultValue
- the value to be returned, if no appropriate object is founddefaultValue
public double getDouble(String key, double defaultValue)
Double
object is stored under the specified key.If the stored object has another numeric type,
it is converted to double
. If it has a non-numeric type or no object is found,
defaultValue
is returned.key
- the key under which the result is storeddefaultValue
- the value to be returned, if no appropriate object is founddefaultValue
public int getInteger(String key, int defaultValue)
Integer
object is stored under the specified key. If the stored object has another type
or no object is found, defaultValue
is returned.key
- the key under which the result is storeddefaultValue
- the value to be returned, if no appropriate object is founddefaultValue
public long getLong(String key, long defaultValue)
Long
object is stored under the specified key. (Objects of the types Integer
are
converted.) If the stored object has another type or no object is found, defaultValue
is returned.key
- the key under which the result is storeddefaultValue
- the value to be returned, if no appropriate object is founddefaultValue
public boolean getBoolean(String key, boolean defaultValue)
Boolean
object is stored under the specified key. If the stored object has another type
or no object is found, defaultValue
is returned.key
- the key under which the result is storeddefaultValue
- the value to be returned, if no appropriate object is founddefaultValue
public File getFile(String key, File defaultValue)
File
object is stored under the specified key. If the stored object has another type
or no object is found, defaultValue
is returned. (This method does not convert String objects
into File objects, even if the string represents a valid file path.)key
- the key under which the result is storeddefaultValue
- the value to be returned, if no appropriate object is founddefaultValue
public File getFile(String key)
File
object is stored under the specified key. If the stored object has another type
or no object is found, null
is returned. (This method does not convert String objects
into File objects, even if the string represents a valid file path.)key
- the key under which the result is storednull
public Object getObject(String key, Object defaultValue)
defaultValue
if no object is found.key
- the key under which the result is storeddefaultValue
- the value to be returned, if no appropriate object is founddefaultValue