public class MultiMap extends Object implements Iterable<Map.Entry<String,String>>
It's useful in Vert.x to represent things in Vert.x like HTTP headers and HTTP parameters which allow multiple values for keys.
NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<MultiMap> |
__TYPE_ARG |
Constructor and Description |
---|
MultiMap(MultiMap delegate) |
MultiMap(Object delegate) |
Modifier and Type | Method and Description |
---|---|
MultiMap |
add(CharSequence name,
CharSequence value)
Like
add(java.lang.String, java.lang.String) but accepting CharSequence as parameters |
MultiMap |
add(CharSequence name,
Iterable<CharSequence> values)
Like
add(java.lang.String, java.lang.String) but accepting CharSequence as parameters |
MultiMap |
add(String name,
Iterable<String> values)
Adds a new values under the specified name
|
MultiMap |
add(String name,
String value)
Adds a new value with the specified name and value.
|
MultiMap |
addAll(Map<String,String> headers)
Adds all the entries from a Map to this
|
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(CharSequence name)
Like
contains(java.lang.String) but accepting a CharSequence as a parameter |
boolean |
contains(CharSequence name,
CharSequence value,
boolean caseInsensitive)
Like
contains(java.lang.String) but accepting CharSequence parameters. |
boolean |
contains(String name)
Checks to see if there is a value with the specified name
|
boolean |
contains(String name,
String value,
boolean caseInsensitive)
Check if there is a header with the specified
name and value . |
List<Map.Entry<String,String>> |
entries()
Returns all entries in the multi-map.
|
boolean |
equals(Object o) |
void |
forEach(java.util.function.BiConsumer<String,String> action)
Allows iterating over the entries in the map
|
String |
get(CharSequence name) |
String |
get(String name)
Returns the value of with the specified name.
|
List<String> |
getAll(CharSequence name)
Like
getAll(java.lang.String) but accepting a CharSequence as a parameter |
List<String> |
getAll(String name)
Returns the values with the specified name
|
MultiMap |
getDelegate() |
int |
hashCode() |
boolean |
isEmpty()
Return true if empty
|
Iterator<Map.Entry<String,String>> |
iterator() |
Set<String> |
names()
Gets a immutable
Set of all names |
static MultiMap |
newInstance(MultiMap arg) |
MultiMap |
remove(CharSequence name)
Like
remove(java.lang.String) but accepting CharSequence as parameters |
MultiMap |
remove(String name)
Removes the value with the given name
|
MultiMap |
set(CharSequence name,
CharSequence value)
Like
set(java.lang.String, java.lang.String) but accepting CharSequence as parameters |
MultiMap |
set(CharSequence name,
Iterable<CharSequence> values)
Like
set(java.lang.String, java.lang.String) but accepting CharSequence as parameters |
MultiMap |
set(String name,
Iterable<String> values)
Sets values for the specified name.
|
MultiMap |
set(String name,
String value)
Sets a
value under the specified name . |
MultiMap |
setAll(Map<String,String> headers)
Cleans and set all values of the given instance
|
MultiMap |
setAll(MultiMap map)
Cleans this instance.
|
int |
size()
Return the number of keys.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final io.vertx.lang.rx.TypeArg<MultiMap> __TYPE_ARG
public MultiMap(MultiMap delegate)
public MultiMap(Object delegate)
public MultiMap getDelegate()
public static MultiMap caseInsensitiveMultiMap()
public String get(String name)
name
- The name of the header to searchnull
if there is no such entrypublic List<String> getAll(String name)
name
- The name to searchList
of values which will be empty if no values are foundpublic boolean contains(String name)
name
- The name to search forpublic boolean contains(String name, String value, boolean caseInsensitive)
name
and value
.
If caseInsensitive
is true
, value
is compared in a case-insensitive way.name
- the name to search forvalue
- the value to search forcaseInsensitive
- true
if at least one entry is foundpublic boolean isEmpty()
public MultiMap add(String name, String value)
name
- The namevalue
- The value being addedpublic MultiMap addAll(MultiMap map)
map
- public MultiMap set(String name, String value)
value
under the specified name
.
If there is an existing header with the same name, it is removed. Setting a null
value removes the entry.
name
- The namevalue
- The valuepublic MultiMap setAll(MultiMap map)
map
- public MultiMap remove(String name)
name
- The name of the value to removepublic MultiMap clear()
public int size()
public String get(CharSequence name)
public List<String> getAll(CharSequence name)
getAll(java.lang.String)
but accepting a CharSequence
as a parametername
- public void forEach(java.util.function.BiConsumer<String,String> action)
action
- public List<Map.Entry<String,String>> entries()
List
of the name-value entries, which will be empty if no pairs are foundpublic boolean contains(CharSequence name)
contains(java.lang.String)
but accepting a CharSequence
as a parametername
- public boolean contains(CharSequence name, CharSequence value, boolean caseInsensitive)
contains(java.lang.String)
but accepting CharSequence
parameters.name
- value
- caseInsensitive
- public MultiMap add(CharSequence name, CharSequence value)
add(java.lang.String, java.lang.String)
but accepting CharSequence
as parametersname
- value
- public MultiMap add(String name, Iterable<String> values)
name
- The name being setvalues
- The valuespublic MultiMap add(CharSequence name, Iterable<CharSequence> values)
add(java.lang.String, java.lang.String)
but accepting CharSequence
as parametersname
- values
- public MultiMap addAll(Map<String,String> headers)
headers
- public MultiMap set(CharSequence name, CharSequence value)
set(java.lang.String, java.lang.String)
but accepting CharSequence
as parametersname
- value
- public MultiMap set(String name, Iterable<String> values)
name
- The name of the headers being setvalues
- The values of the headers being setpublic MultiMap set(CharSequence name, Iterable<CharSequence> values)
set(java.lang.String, java.lang.String)
but accepting CharSequence
as parametersname
- values
- public MultiMap setAll(Map<String,String> headers)
headers
- public MultiMap remove(CharSequence name)
remove(java.lang.String)
but accepting CharSequence
as parametersname
- Copyright © 2022 Eclipse. All rights reserved.