new MultiMap(multiMap)
A
MultiMap
is a type of Map object that can store more
than one value for a given key. This is useful for storing and passing
around things like HTTP headers where a single header can have multiple
values.
Parameters:
Name | Type | Description |
---|---|---|
multiMap |
org.vertx.java.core.MultiMap | the underlying Java MultiMap instance |
- Source:
Methods
-
add(name, value) → {module:vertx/multi_map~MultiMap}
-
Add a value for the given name
Parameters:
Name Type Description name
string The name under which the value should be stored value
string The value to store - Source:
Returns:
-
clear() → {module:vertx/multi_map~MultiMap}
-
Clears the map
- Source:
Returns:
self -
contains(name) → {boolean}
-
Returns if a value for the given name is stored
Parameters:
Name Type Description name
string The name to check for - Source:
Returns:
true
ifname
is stored in this map- Type
- boolean
-
forEach(func)
-
Execute the given function for every name, value pair stored
Parameters:
Name Type Description func
function The function to execute - Source:
-
get(name) → {string}
-
Return the value for the given name
Parameters:
Name Type Description name
string The name to lookup in the map - Source:
Returns:
value The value for the given name. If more than one value maps toname
, the first value is returned.- Type
- string
-
getAll(name) → {Array}
-
Return all values stored for the given name.
Parameters:
Name Type Description name
string The name to lookup values for - Source:
Returns:
The values for the given name- Type
- Array
-
isEmpty() → {boolean}
-
Returns if this map is empty
- Source:
Returns:
true
if empty- Type
- boolean
-
names() → {Array}
-
Return all names for which values are stored
- Source:
Returns:
The names for which values are stored- Type
- Array
-
remove(name) → {module:vertx/multi_map~MultiMap}
-
Remove all values stored under the name
Parameters:
Name Type Description name
string The name for which all values should be removed - Source:
Returns:
self -
set(name, value) → {module:vertx/multi_map~MultiMap}
-
Set a value for the given name. All previous stored values under the name will get deleted.
Parameters:
Name Type Description name
string The name under which the value should be stored value
string The value to store - Source:
Returns:
-
setMap(The) → {module:vertx/multi_map~MultiMap}
-
Set the content of the given map.
Parameters:
Name Type Description The
module:vertx/multi_map~MultiMap map to set - Source:
Returns:
self -
size() → {number}
-
Return the number of names stored.
- Source:
Returns:
the number of names stored- Type
- number