Package com.reportmill.base
Class RMMapUtils
java.lang.Object
com.reportmill.base.RMMapUtils
Utility methods for use with Java.util.Map.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
anyElement
(Map aMap) Returns any element from a map.static boolean
Returns a key value interpreted as a boolean.static boolean
Returns a key value interpreted as a boolean (with optional default value).static Map
Clones a map.static float
floatValue
(Map aMap, String aKey) Returns a key value interpreted as a float.static float
floatValue
(Map aMap, String aKey, float defaultValue) Returns a key value interpreted as a float (with optional default value).static Object
Returns value for aKey in given map (accepts null map).static Object
Returns value for aKey in given map with an optional default value for missing keys.static Object
Returns the key for a given object in the given map.static Object
getKeyIdentical
(Map aMap, Object aValue) Returns the key for a given identical object in the given map.static int
Returns a key value interpreted as an int.static int
Returns a key value interpreted as an int (with optional default value).static Map
Creates a new map for given key and object.static void
Adds given key and value to given map (removes key if value is null).static Map
putAllIfAbsent
(Map m1, Map m2, boolean copyIfAbsent) Same as putAll, but only adds absent keys (option to copy if there are absent keys).static void
Renames a key in a map to a new key.static int
Returns the size of given map (accepts null map).
-
Constructor Details
-
RMMapUtils
public RMMapUtils()
-
-
Method Details
-
newMap
Creates a new map for given key and object. -
size
Returns the size of given map (accepts null map). -
get
Returns value for aKey in given map (accepts null map). -
get
Returns value for aKey in given map with an optional default value for missing keys. -
put
Adds given key and value to given map (removes key if value is null). -
rename
Renames a key in a map to a new key. -
clone
Clones a map. -
boolValue
Returns a key value interpreted as a boolean. -
boolValue
Returns a key value interpreted as a boolean (with optional default value). -
intValue
Returns a key value interpreted as an int. -
intValue
Returns a key value interpreted as an int (with optional default value). -
floatValue
Returns a key value interpreted as a float. -
floatValue
Returns a key value interpreted as a float (with optional default value). -
putAllIfAbsent
Same as putAll, but only adds absent keys (option to copy if there are absent keys). -
getKey
Returns the key for a given object in the given map. -
getKeyIdentical
Returns the key for a given identical object in the given map. -
anyElement
Returns any element from a map.
-