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 ObjectanyElement(Map aMap) Returns any element from a map.static booleanReturns a key value interpreted as a boolean.static booleanReturns a key value interpreted as a boolean (with optional default value).static MapClones a map.static floatfloatValue(Map aMap, String aKey) Returns a key value interpreted as a float.static floatfloatValue(Map aMap, String aKey, float defaultValue) Returns a key value interpreted as a float (with optional default value).static ObjectReturns value for aKey in given map (accepts null map).static ObjectReturns value for aKey in given map with an optional default value for missing keys.static ObjectReturns the key for a given object in the given map.static ObjectgetKeyIdentical(Map aMap, Object aValue) Returns the key for a given identical object in the given map.static intReturns a key value interpreted as an int.static intReturns a key value interpreted as an int (with optional default value).static MapCreates a new map for given key and object.static voidAdds given key and value to given map (removes key if value is null).static MapputAllIfAbsent(Map m1, Map m2, boolean copyIfAbsent) Same as putAll, but only adds absent keys (option to copy if there are absent keys).static voidRenames a key in a map to a new key.static intReturns 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.
-