This class represents a MultiMap of String keys to a List of String values.
It's useful in Vert.x to represent things in Vert.x like HTTP headers and HTTP parameters which allow multiple values for keys.
Constructor and description |
---|
MultiMap
(java.lang.Object delegate) |
Type | Name and description |
---|---|
MultiMap |
add(java.lang.String name, java.lang.String value) Adds a new value with the specified name and value. |
MultiMap |
addAll(MultiMap map) Adds all the entries from another MultiMap to this one |
static MultiMap |
caseInsensitiveMultiMap() Create a multi-map implementation with case insensitive keys, for instance it can be used to hold some HTTP headers. |
MultiMap |
clear() Removes all |
boolean |
contains(java.lang.String name) Checks to see if there is a value with the specified name |
java.lang.String |
get(java.lang.String name) Returns the value of with the specified name. |
java.util.List<java.lang.String> |
getAll(java.lang.String name) Returns the values with the specified name |
java.lang.Object |
getDelegate() |
boolean |
isEmpty() Return true if empty @return |
java.util.Set<java.lang.String> |
names() Gets a immutable java.util.Set of all names |
MultiMap |
remove(java.lang.String name) Removes the value with the given name |
MultiMap |
set(java.lang.String name, java.lang.String value) Sets a value under the specified name. |
MultiMap |
setAll(MultiMap map) Cleans this instance. |
int |
size() Return the number of keys. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Adds a new value with the specified name and value.
name
- The namevalue
- The value being addedAdds all the entries from another MultiMap to this one
Create a multi-map implementation with case insensitive keys, for instance it can be used to hold some HTTP headers.
Removes all
Checks to see if there is a value with the specified name
name
- The name to search forReturns the value of with the specified name. If there are more than one values for the specified name, the first value is returned.
null
if there is no such entryname
- The name of the header to searchReturns the values with the specified name
name
- The name to searchReturn true if empty
Gets a immutable java.util.Set of all names
Removes the value with the given name
name
- The name of the value to removeSets a value under the specified name.
If there is an existing header with the same name, it is removed.
name
- The namevalue
- The valueCleans this instance.
Return the number of keys.