Top Description Inners Fields Constructors Methods
io.vertx.core.http.impl.headers

public final Class HeadersMultiMap

extends HttpHeaders
implements MultiMap
Class Inheritance
All Implemented Interfaces
io.vertx.core.MultiMap, java.lang.Iterable
Imports
io.netty.buffer.ByteBuf, .ByteBufUtil, io.netty.handler.codec.http.HttpHeaders, io.netty.util.AsciiString, .CharsetUtil, io.vertx.core.MultiMap, io.vertx.core.http.impl.HttpUtils, java.util.AbstractMap, .Arrays, .Collections, .Iterator, .LinkedList, .List, .Map, .NoSuchElementException, .Objects, .Set, .TreeSet, java.util.function.BiConsumer, .Consumer

A case-insensitive MultiMap implementation that extends Netty HttpHeaders for convenience.
Author
Julien Viet

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private static final int
pack-priv static final int
private final HeadersMultiMap.MapEntry[]
private final HeadersMultiMap.MapEntry
pack-priv static final BiConsumer<CharSequence, CharSequence>
private final BiConsumer<CharSequence, CharSequence>
Inherited from io.netty.handler.codec.http.HttpHeaders:
EMPTY_HEADERS

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public HeadersMultiMap
add(CharSequence name, CharSequence value)

Implements io.vertx.core.MultiMap.add.

Like add(String, String) but accepting CharSequence as parameters

public HeadersMultiMap
add(CharSequence
The name of the header being added
name
,
Object
The value of the header being added
value
)

Overrides io.netty.handler.codec.http.HttpHeaders.add.

Adds a new header with the specified name and value.

public HttpHeaders
public HeadersMultiMap
add(String
The name
name
,
String
The value being added
strVal
)

Implements io.vertx.core.MultiMap.add.

Adds a new value with the specified name and value.

public HeadersMultiMap
add(CharSequence
The name of the headers being set
name
,
Iterable<T>
The values of the headers being set
values
)

Overrides io.netty.handler.codec.http.HttpHeaders.add.

Implements io.vertx.core.MultiMap.add.

Like add(String, Iterable) but accepting CharSequence as parameters

public HeadersMultiMap
add(String
The name being set
name
,
Iterable<T>
The values
values
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.add.

Implements io.vertx.core.MultiMap.add.

Adds a new values under the specified name

private void
add0(int h, int i, final CharSequence name, final CharSequence value)

public MultiMap
addAll(MultiMap headers)

Implements io.vertx.core.MultiMap.addAll.

Adds all the entries from another MultiMap to this one

public MultiMap
addAll(Map<String, String> map)

Implements io.vertx.core.MultiMap.addAll.

Adds all the entries from a Map to this

private MultiMap
public HttpHeaders
addInt(CharSequence
The name to modify
name
,
int
The value
value
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.addInt.

Add the name to value.

public HttpHeaders
addShort(CharSequence
The name to modify
name
,
short
The value
value
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.addShort.

Add the name to value.

public HeadersMultiMap
public boolean
contains(CharSequence
the name of the header to find
name
,
CharSequence
the value of the header to find
value
,
boolean
true then a case insensitive compare is run to compare values. otherwise a case sensitive compare is run to compare values.
ignoreCase
)

Overrides io.netty.handler.codec.http.HttpHeaders.contains.

Overrides default io.vertx.core.MultiMap.contains.

Like contains(String, String, boolean) but accepting CharSequence parameters.

public boolean
contains(String
the name to search for
name
,
String
the value to search for
value
,
boolean ignoreCase)

Overrides io.netty.handler.codec.http.HttpHeaders.contains.

Overrides default io.vertx.core.MultiMap.contains.

Check if there is a header with the specified name and value.

public boolean
contains(CharSequence
The name of the header to search for
name
)

Overrides io.netty.handler.codec.http.HttpHeaders.contains.

Implements io.vertx.core.MultiMap.contains.

Like contains(String) but accepting a CharSequence as a parameter

public boolean
contains(String
The name to search for
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.contains.

Implements io.vertx.core.MultiMap.contains.

Checks to see if there is a value with the specified name

private boolean
containsInternal(CharSequence name, CharSequence value, boolean equals, boolean ignoreCase)

public boolean
containsValue(CharSequence
the name of the header to find
name
,
CharSequence
the value of the header to find
value
,
boolean
true then a case insensitive compare is run to compare values. otherwise a case sensitive compare is run to compare values.
ignoreCase
)

Overrides io.netty.handler.codec.http.HttpHeaders.containsValue.

Returns true if a header with the name and value exists, false otherwise.

public void
pack-priv static void
public List<Map.Entry<String, String>>
entries()

Overrides default io.vertx.core.MultiMap.entries.

Implements abstract io.netty.handler.codec.http.HttpHeaders.entries.

Returns all entries in the multi-map.

public void
forEach(Consumer<? super Map.Entry<String, String>>
The action to be performed for each element
action
)

Overrides default java.lang.Iterable.forEach.

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.

public void
forEach(BiConsumer<String, String> action)

Overrides default io.vertx.core.MultiMap.forEach.

Allows iterating over the entries in the map

public String
get(CharSequence
The name of the header to search
name
)

Overrides io.netty.handler.codec.http.HttpHeaders.get.

Implements io.vertx.core.MultiMap.get.

Returns the value of a header with the specified name.

public String
get(String
The name of the header to search
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.get.

Implements io.vertx.core.MultiMap.get.

Returns the value of with the specified name.

private CharSequence
public List<String>
getAll(CharSequence
The name of the headers to search
name
)

Overrides io.netty.handler.codec.http.HttpHeaders.getAll.

Implements io.vertx.core.MultiMap.getAll.

Like getAll(String) but accepting a CharSequence as a parameter

public List<String>
getAll(String
The name to search
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getAll.

Implements io.vertx.core.MultiMap.getAll.

Returns the values with the specified name

public Integer
getInt(CharSequence
the name of the header to search
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getInt.

Returns the integer value of a header with the specified name.

public int
getInt(CharSequence
the name of the header to search
name
,
int
the default value
defaultValue
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getInt.

Returns the integer value of a header with the specified name.

public Short
getShort(CharSequence
the name of the header to search
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getShort.

Returns the short value of a header with the specified name.

public short
getShort(CharSequence
the name of the header to search
name
,
short
the default value
defaultValue
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getShort.

Returns the short value of a header with the specified name.

public Long
getTimeMillis(CharSequence
the name of the header to search
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getTimeMillis.

Returns the date value of a header with the specified name.

public long
getTimeMillis(CharSequence
the name of the header to search
name
,
long
the default value
defaultValue
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.getTimeMillis.

Returns the date value of a header with the specified name.

public static HeadersMultiMap

Returns:

a all-purpose case insensitive multi-map that does not perform validation
headers
()

public static HeadersMultiMap

Returns:

a case insensitive multi-map suited for HTTP header validation
httpHeaders
()

public boolean
isEmpty()

Implements abstract io.netty.handler.codec.http.HttpHeaders.isEmpty.

Implements io.vertx.core.MultiMap.isEmpty.

Return true if empty

public Iterator<Map.Entry<String, String>>
iterator()

Implements abstract io.netty.handler.codec.http.HttpHeaders.iterator.

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public Iterator<Map.Entry<CharSequence, CharSequence>>
public Set<String>
names()

Implements abstract io.netty.handler.codec.http.HttpHeaders.names.

Implements io.vertx.core.MultiMap.names.

Gets a immutable java.util.Set of all names

public HeadersMultiMap
remove(CharSequence
The name of the header to remove
name
)

Overrides io.netty.handler.codec.http.HttpHeaders.remove.

Implements io.vertx.core.MultiMap.remove.

Like remove(String) but accepting CharSequence as parameters

public HeadersMultiMap
remove(final String
The name of the value to remove
name
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.remove.

Implements io.vertx.core.MultiMap.remove.

Removes the value with the given name

private void
remove0(int h, int i, CharSequence name)

public HeadersMultiMap
set(CharSequence name, CharSequence value)

Implements io.vertx.core.MultiMap.set.

Like set(String, String) but accepting CharSequence as parameters

public HeadersMultiMap
set(String
The name
name
,
String
The value
value
)

Implements io.vertx.core.MultiMap.set.

Sets a value under the specified name.

public HeadersMultiMap
public HeadersMultiMap
set(CharSequence
The name of the header being set
name
,
Object
The value of the header being set
value
)

Overrides io.netty.handler.codec.http.HttpHeaders.set.

Sets a header with the specified name and value.

public HeadersMultiMap
set(CharSequence
The name of the headers being set
name
,
Iterable<T>
The values of the headers being set
values
)

Overrides io.netty.handler.codec.http.HttpHeaders.set.

Implements io.vertx.core.MultiMap.set.

Like set(String, Iterable) but accepting CharSequence as parameters

public HeadersMultiMap
set(String
The name of the headers being set
name
,
Iterable<T>
The values of the headers being set
values
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.set.

Implements io.vertx.core.MultiMap.set.

Sets values for the specified name.

private HeadersMultiMap
set0(final CharSequence name, final CharSequence strVal)

private MultiMap
public MultiMap
setAll(MultiMap headers)

Implements io.vertx.core.MultiMap.setAll.

Cleans this instance.

public MultiMap
setAll(Map<String, String> headers)

Implements io.vertx.core.MultiMap.setAll.

Cleans and set all values of the given instance

public HttpHeaders
setInt(CharSequence
The name to modify
name
,
int
The value
value
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.setInt.

Set the name to value.

public HttpHeaders
setShort(CharSequence
The name to modify
name
,
short
The value
value
)

Implements abstract io.netty.handler.codec.http.HttpHeaders.setShort.

Set the name to value.

public int
size()

Implements abstract io.netty.handler.codec.http.HttpHeaders.size.

Implements io.vertx.core.MultiMap.size.

Return the number of keys.

public String
toString()

Overrides io.netty.handler.codec.http.HttpHeaders.toString.

Returns a string representation of the object.

private static CharSequence

Returns:

the char sequence
toValidCharSequence
(Object
the value
value
)

Convert the value to a non null CharSequence

private static void
writeAscii(ByteBuf buf, int offset, CharSequence value)

Inherited from io.netty.handler.codec.http.HttpHeaders:
addaddDateHeaderaddDateHeaderaddHeaderaddHeaderaddIntHeaderaddIntHeaderclearHeaderscopyencodeAsciiequalsIgnoreCasegetgetAllAsStringgetAsStringgetContentLengthgetContentLengthgetDategetDategetDateHeadergetDateHeadergetDateHeadergetDateHeadergetHeadergetHeadergetHeadergetHeadergetHostgetHostgetIntHeadergetIntHeadergetIntHeadergetIntHeaderis100ContinueExpectedisContentLengthSetisKeepAliveisTransferEncodingChunkediteratorAsStringnewEntityremoveHeaderremoveHeaderremoveTransferEncodingChunkedsetset100ContinueExpectedset100ContinueExpectedsetAllsetContentLengthsetDatesetDateHeadersetDateHeadersetDateHeadersetDateHeadersetHeadersetHeadersetHeadersetHeadersetHostsetHostsetIntHeadersetIntHeadersetIntHeadersetIntHeadersetKeepAlivesetTransferEncodingChunkedvalueCharSequenceIteratorvalueStringIterator