Map¶
Definition¶
Extends¶
Extended By¶
Description¶
A mutable collection of unique keys which are mapped to values. Attempts to add duplicates will override existing key-value pairs. Entries are stored in the order inserted (Backed by java LinkedHashMap)
Method Summary¶
Owner | Name | Return Type | Description |
---|---|---|---|
Map | constructor(key_values) | Object | Init list |
Map | clear() | Boolean | Removes all the mappings from this map. Returns true if the map is changed as a result. |
Map | containsKey(key) | Boolean | Returns true if this map contains the specified key. |
Map | containsValue(value) | Boolean | Returns true if this map contains the specified value. |
Map | get(key) | Object | Returns the value associated with the given key. Returns null if key does not exist. |
Object | getClassName() | String | Returns the string name of this object's class type. |
Map | getKeys() | Set | Returns the keys as a set. |
Map | getValues() | List | Returns the values as a list. |
Map | jsonPath(jsonPath) | Object | Walks the JSON path and returns the object at the end of the path. Returns itself if path is null. Use dot(.) to delimit path. Use number to traverse list element and key to traverse map. |
Map | put(key, value) | Object | Adds the specified key value pair to this map and returns old value associated with the key. Returns null if key does not exist. |
Map | putAll(m) | Object | Copies all the mappies of the target map to this map |
Map | remove(key) | Object | Removes the given key and returns the value associated with the key. Returns null if the key does not exist. |
Map | size() | Integer | Returns the number of key/value pairs in this map. |
Object | toJson() | String | Returns a json representation of this object. |
Method Definitions¶
constructor(key_values)¶
Map map = new Map(Object ... key_values)
Description¶
Init list
Parameter Definition¶
Name | Type | Description |
---|---|---|
key_values | Object ... | initialize list with arguments |
clear()¶
Description¶
Removes all the mappings from this map. Returns true if the map is changed as a result.
containsKey(key)¶
Boolean Map::containsKey(Object key)
Description¶
Returns true if this map contains the specified key.
Parameter Definition¶
Name | Type | Description |
---|---|---|
key | Object |
containsValue(value)¶
Boolean Map::containsValue(Object value)
Description¶
Returns true if this map contains the specified value.
Parameter Definition¶
Name | Type | Description |
---|---|---|
value | Object |
get(key)¶
Description¶
Returns the value associated with the given key. Returns null if key does not exist.
Parameter Definition¶
Name | Type | Description |
---|---|---|
key | Object |
getKeys()¶
Description¶
Returns the keys as a set.
getValues()¶
Description¶
Returns the values as a list.
jsonPath(jsonPath)¶
Object Map::jsonPath(String jsonPath)
Description¶
Walks the JSON path and returns the object at the end of the path. Returns itself if path is null. Use dot(.) to delimit path. Use number to traverse list element and key to traverse map.
Parameter Definition¶
Name | Type | Description |
---|---|---|
jsonPath | String | dot(.) delimited path Ex: "portletConfigs.0.portletConfig.dm.0" |
put(key,value)¶
Object Map::put(Object key, Object value)
Description¶
Adds the specified key value pair to this map and returns old value associated with the key. Returns null if key does not exist.
Parameter Definition¶
Name | Type | Description |
---|---|---|
key | Object | |
value | Object |
putAll(m)¶
Description¶
Copies all the mappies of the target map to this map
Parameter Definition¶
Name | Type | Description |
---|---|---|
m | Map | map |
remove(key)¶
Object Map::remove(Object key)
Description¶
Removes the given key and returns the value associated with the key. Returns null if the key does not exist.
Parameter Definition¶
Name | Type | Description |
---|---|---|
key | Object |
size()¶
Description¶
Returns the number of key/value pairs in this map.