Interface MultiMap
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.
- Author:
- Norman Maurer, Tim Fox
-
Method Summary
Modifier and TypeMethodDescriptionadd(CharSequence name, CharSequence value) Likeadd(String, String)but acceptingCharSequenceas parametersadd(CharSequence name, Iterable<CharSequence> values) Likeadd(String, Iterable)but acceptingCharSequenceas parametersAdds a new values under the specified nameAdds a new value with the specified name and value.Adds all the entries from another MultiMap to this oneAdds all the entries from a Map to thisstatic MultiMapCreate a multi-map implementation with case insensitive keys, for instance it can be used to hold some HTTP headers.clear()Removes allbooleancontains(CharSequence name) Likecontains(String)but accepting aCharSequenceas a parameterdefault booleancontains(CharSequence name, CharSequence value, boolean caseInsensitive) Likecontains(String, String, boolean)but acceptingCharSequenceparameters.booleanChecks to see if there is a value with the specified namedefault booleanCheck if there is a header with the specifiednameandvalue.default MultiMapcopy()Returns a mutable copy of this instance.copy(boolean mutable) Returns a copy of this instance.entries()Returns all entries in the multi-map.default voidforEach(BiConsumer<String, String> action) Allows iterating over the entries in the mapget(CharSequence name) Returns the value of with the specified name.getAll(CharSequence name) LikegetAll(String)but accepting aCharSequenceas a parameterReturns the values with the specified namebooleanisEmpty()Return true if emptybooleannames()Gets a immutableSetof all namesremove(CharSequence name) Likeremove(String)but acceptingCharSequenceas parametersRemoves the value with the given nameset(CharSequence name, CharSequence value) Likeset(String, String)but acceptingCharSequenceas parametersset(CharSequence name, Iterable<CharSequence> values) Likeset(String, Iterable)but acceptingCharSequenceas parametersSets values for the specified name.Sets avalueunder the specifiedname.Cleans this instance.Cleans and set all values of the given instanceintsize()Return the number of keys.Methods inherited from interface Iterable
forEach, iterator, spliterator
-
Method Details
-
caseInsensitiveMultiMap
Create a multi-map implementation with case insensitive keys, for instance it can be used to hold some HTTP headers.- Returns:
- the multi-map
-
get
-
get
-
getAll
-
getAll
LikegetAll(String)but accepting aCharSequenceas a parameter -
forEach
Allows iterating over the entries in the map -
entries
-
contains
Checks to see if there is a value with the specified name- Parameters:
name- The name to search for- Returns:
- true if at least one entry is found
-
contains
Likecontains(String)but accepting aCharSequenceas a parameter -
contains
Check if there is a header with the specifiednameandvalue. IfcaseInsensitiveistrue,valueis compared in a case-insensitive way.- Parameters:
name- the name to search forvalue- the value to search for- Returns:
trueif at least one entry is found
-
contains
Likecontains(String, String, boolean)but acceptingCharSequenceparameters. -
isEmpty
boolean isEmpty()Return true if empty -
names
-
add
-
add
Likeadd(String, String)but acceptingCharSequenceas parameters -
add
-
add
Likeadd(String, Iterable)but acceptingCharSequenceas parameters -
addAll
-
addAll
-
set
-
set
Likeset(String, String)but acceptingCharSequenceas parameters -
set
-
set
Likeset(String, Iterable)but acceptingCharSequenceas parameters -
setAll
-
setAll
-
remove
-
remove
Likeremove(String)but acceptingCharSequenceas parameters -
clear
-
size
int size()Return the number of keys. -
isMutable
boolean isMutable()- Returns:
- whether this instance can be mutated.
-
copy
Returns a copy of this instance.- Parameters:
mutable- whether the copy can be mutated- Returns:
- a copy of this instance
-
copy
Returns a mutable copy of this instance.- Returns:
- a mutable copy of this instance
-