- java.lang.Object
-
- io.netty5.handler.codec.http2.ReadOnlyHttp2Headers
-
- All Implemented Interfaces:
Headers<CharSequence,CharSequence,Http2Headers>
,Http2Headers
,Iterable<Map.Entry<CharSequence,CharSequence>>
public final class ReadOnlyHttp2Headers extends Object implements Http2Headers
A variant ofHttp2Headers
which only supports read-only methods.Any array passed to this class may be used directly in the underlying data structures of this class. If these arrays may be modified it is the caller's responsibility to supply this class with a copy of the array.
This may be a good alternative to
DefaultHttp2Headers
if your have a fixed set of headers which will not change.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty5.handler.codec.http2.Http2Headers
Http2Headers.PseudoHeaderName
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Http2Headers
add(Headers<? extends CharSequence,? extends CharSequence,?> headers)
Adds all header names and values ofheaders
to this object.Http2Headers
add(CharSequence name, CharSequence value)
Adds a new header with the specifiedname
andvalue
.Http2Headers
add(CharSequence name, CharSequence... values)
Adds new headers with the specifiedname
andvalues
.Http2Headers
add(CharSequence name, Iterable<? extends CharSequence> values)
Adds new headers with the specifiedname
andvalues
.Http2Headers
addBoolean(CharSequence name, boolean value)
Adds a new header.Http2Headers
addByte(CharSequence name, byte value)
Adds a new header.Http2Headers
addChar(CharSequence name, char value)
Adds a new header.Http2Headers
addDouble(CharSequence name, double value)
Adds a new header.Http2Headers
addFloat(CharSequence name, float value)
Adds a new header.Http2Headers
addInt(CharSequence name, int value)
Adds a new header.Http2Headers
addLong(CharSequence name, long value)
Adds a new header.Http2Headers
addObject(CharSequence name, Iterable<?> values)
Adds a new header with the specified name and values.Http2Headers
addObject(CharSequence name, Object value)
Adds a new header.Http2Headers
addObject(CharSequence name, Object... values)
Adds a new header with the specified name and values.Http2Headers
addShort(CharSequence name, short value)
Adds a new header.Http2Headers
addTimeMillis(CharSequence name, long value)
Adds a new header.CharSequence
authority()
Gets theHttp2Headers.PseudoHeaderName.AUTHORITY
header ornull
if there is no such headerHttp2Headers
authority(CharSequence value)
Sets theHttp2Headers.PseudoHeaderName.AUTHORITY
headerHttp2Headers
clear()
Removes all headers.static ReadOnlyHttp2Headers
clientHeaders(boolean validateHeaders, AsciiString method, AsciiString path, AsciiString scheme, AsciiString authority, AsciiString... otherHeaders)
Create a new read only representation of headers used by clients.boolean
contains(CharSequence name)
Returnstrue
if a header with thename
exists,false
otherwise.boolean
contains(CharSequence name, CharSequence value)
Returnstrue
if a header with thename
andvalue
exists,false
otherwise.boolean
contains(CharSequence name, CharSequence value, boolean caseInsensitive)
Returnstrue
if a header with thename
andvalue
exists,false
otherwise.boolean
containsBoolean(CharSequence name, boolean value)
Returnstrue
if a header with the name and value exists.boolean
containsByte(CharSequence name, byte value)
Returnstrue
if a header with the name and value exists.boolean
containsChar(CharSequence name, char value)
Returnstrue
if a header with the name and value exists.boolean
containsDouble(CharSequence name, double value)
Returnstrue
if a header with the name and value exists.boolean
containsFloat(CharSequence name, float value)
Returnstrue
if a header with the name and value exists.boolean
containsInt(CharSequence name, int value)
Returnstrue
if a header with the name and value exists.boolean
containsLong(CharSequence name, long value)
Returnstrue
if a header with the name and value exists.boolean
containsObject(CharSequence name, Object value)
Returnstrue
if a header with the name and value exists.boolean
containsShort(CharSequence name, short value)
Returnstrue
if a header with the name and value exists.boolean
containsTimeMillis(CharSequence name, long value)
Returnstrue
if a header with the name and value exists.CharSequence
get(CharSequence name)
Returns the value of a header with the specified name.CharSequence
get(CharSequence name, CharSequence defaultValue)
Returns the value of a header with the specified name.List<CharSequence>
getAll(CharSequence name)
Returns all values for the header with the specified name.List<CharSequence>
getAllAndRemove(CharSequence name)
Returns all values for the header with the specified name and removes them from this object.CharSequence
getAndRemove(CharSequence name)
Returns the value of a header with the specified name and removes it from this object.CharSequence
getAndRemove(CharSequence name, CharSequence defaultValue)
Returns the value of a header with the specified name and removes it from this object.Boolean
getBoolean(CharSequence name)
Returns theboolean
value of a header with the specified name.boolean
getBoolean(CharSequence name, boolean defaultValue)
Returns theboolean
value of a header with the specified name.Boolean
getBooleanAndRemove(CharSequence name)
Returns theboolean
value of a header with the specifiedname
and removes the header from this object.boolean
getBooleanAndRemove(CharSequence name, boolean defaultValue)
Returns theboolean
value of a header with the specifiedname
and removes the header from this object.Byte
getByte(CharSequence name)
Returns thebyte
value of a header with the specified name.byte
getByte(CharSequence name, byte defaultValue)
Returns thebyte
value of a header with the specified name.Byte
getByteAndRemove(CharSequence name)
Returns thebyte
value of a header with the specifiedname
and removes the header from this object.byte
getByteAndRemove(CharSequence name, byte defaultValue)
Returns thebyte
value of a header with the specifiedname
and removes the header from this object.Character
getChar(CharSequence name)
Returns thechar
value of a header with the specified name.char
getChar(CharSequence name, char defaultValue)
Returns thechar
value of a header with the specified name.Character
getCharAndRemove(CharSequence name)
Returns thechar
value of a header with the specifiedname
and removes the header from this object.char
getCharAndRemove(CharSequence name, char defaultValue)
Returns thechar
value of a header with the specifiedname
and removes the header from this object.Double
getDouble(CharSequence name)
Returns thedouble
value of a header with the specified name.double
getDouble(CharSequence name, double defaultValue)
Returns thedouble
value of a header with the specified name.Double
getDoubleAndRemove(CharSequence name)
Returns thedouble
value of a header with the specifiedname
and removes the header from this object.double
getDoubleAndRemove(CharSequence name, double defaultValue)
Returns thedouble
value of a header with the specifiedname
and removes the header from this object.Float
getFloat(CharSequence name)
Returns thefloat
value of a header with the specified name.float
getFloat(CharSequence name, float defaultValue)
Returns thefloat
value of a header with the specified name.Float
getFloatAndRemove(CharSequence name)
Returns thefloat
value of a header with the specifiedname
and removes the header from this object.float
getFloatAndRemove(CharSequence name, float defaultValue)
Returns thefloat
value of a header with the specifiedname
and removes the header from this object.Integer
getInt(CharSequence name)
Returns theint
value of a header with the specified name.int
getInt(CharSequence name, int defaultValue)
Returns theint
value of a header with the specified name.Integer
getIntAndRemove(CharSequence name)
Returns theint
value of a header with the specifiedname
and removes the header from this object.int
getIntAndRemove(CharSequence name, int defaultValue)
Returns theint
value of a header with the specifiedname
and removes the header from this object.Long
getLong(CharSequence name)
Returns thelong
value of a header with the specified name.long
getLong(CharSequence name, long defaultValue)
Returns thelong
value of a header with the specified name.Long
getLongAndRemove(CharSequence name)
Returns thelong
value of a header with the specifiedname
and removes the header from this object.long
getLongAndRemove(CharSequence name, long defaultValue)
Returns thelong
value of a header with the specifiedname
and removes the header from this object.Short
getShort(CharSequence name)
Returns theshort
value of a header with the specified name.short
getShort(CharSequence name, short defaultValue)
Returns theshort
value of a header with the specified name.Short
getShortAndRemove(CharSequence name)
Returns theshort
value of a header with the specifiedname
and removes the header from this object.short
getShortAndRemove(CharSequence name, short defaultValue)
Returns theshort
value of a header with the specifiedname
and removes the header from this object.Long
getTimeMillis(CharSequence name)
Returns the value of a header with the specified name in milliseconds.long
getTimeMillis(CharSequence name, long defaultValue)
Returns the value of a header with the specified name in milliseconds.Long
getTimeMillisAndRemove(CharSequence name)
Returns the value of a header with the specifiedname
in milliseconds and removes the header from this object.long
getTimeMillisAndRemove(CharSequence name, long defaultValue)
Returns the value of a header with the specifiedname
in milliseconds and removes the header from this object.boolean
isEmpty()
Iterator<Map.Entry<CharSequence,CharSequence>>
iterator()
Returns an iterator over all HTTP/2 headers.CharSequence
method()
Gets theHttp2Headers.PseudoHeaderName.METHOD
header ornull
if there is no such headerHttp2Headers
method(CharSequence value)
Sets theHttp2Headers.PseudoHeaderName.METHOD
headerSet<CharSequence>
names()
Returns aSet
of all header names in this object.CharSequence
path()
Gets theHttp2Headers.PseudoHeaderName.PATH
header ornull
if there is no such headerHttp2Headers
path(CharSequence value)
Sets theHttp2Headers.PseudoHeaderName.PATH
headerboolean
remove(CharSequence name)
Removes all headers with the specifiedname
.CharSequence
scheme()
Gets theHttp2Headers.PseudoHeaderName.SCHEME
header ornull
if there is no such headerHttp2Headers
scheme(CharSequence value)
Sets theHttp2Headers.PseudoHeaderName.SCHEME
headerstatic ReadOnlyHttp2Headers
serverHeaders(boolean validateHeaders, AsciiString status, AsciiString... otherHeaders)
Create a new read only representation of headers used by servers.Http2Headers
set(Headers<? extends CharSequence,? extends CharSequence,?> headers)
Clears the current header entries and copies all header entries of the specifiedheaders
.Http2Headers
set(CharSequence name, CharSequence value)
Sets a header with the specified name and value.Http2Headers
set(CharSequence name, CharSequence... values)
Sets a header with the specified name and values.Http2Headers
set(CharSequence name, Iterable<? extends CharSequence> values)
Sets a new header with the specified name and values.Http2Headers
setAll(Headers<? extends CharSequence,? extends CharSequence,?> headers)
Retains all current headers but calls#set(K, V)
for each entry inheaders
.Http2Headers
setBoolean(CharSequence name, boolean value)
Set thename
tovalue
.Http2Headers
setByte(CharSequence name, byte value)
Set thename
tovalue
.Http2Headers
setChar(CharSequence name, char value)
Set thename
tovalue
.Http2Headers
setDouble(CharSequence name, double value)
Set thename
tovalue
.Http2Headers
setFloat(CharSequence name, float value)
Set thename
tovalue
.Http2Headers
setInt(CharSequence name, int value)
Set thename
tovalue
.Http2Headers
setLong(CharSequence name, long value)
Set thename
tovalue
.Http2Headers
setObject(CharSequence name, Iterable<?> values)
Sets a header with the specified name and values.Http2Headers
setObject(CharSequence name, Object value)
Sets a new header.Http2Headers
setObject(CharSequence name, Object... values)
Sets a header with the specified name and values.Http2Headers
setShort(CharSequence name, short value)
Set thename
tovalue
.Http2Headers
setTimeMillis(CharSequence name, long value)
Set thename
tovalue
.int
size()
Returns the number of headers in this object.CharSequence
status()
Gets theHttp2Headers.PseudoHeaderName.STATUS
header ornull
if there is no such headerHttp2Headers
status(CharSequence value)
Sets theHttp2Headers.PseudoHeaderName.STATUS
headerString
toString()
static ReadOnlyHttp2Headers
trailers(boolean validateHeaders, AsciiString... otherHeaders)
Used to create read only object designed to represent trailers.Iterator<CharSequence>
valueIterator(CharSequence name)
Equivalent toHeaders.getAll(Object)
but no intermediate list is generated.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
trailers
public static ReadOnlyHttp2Headers trailers(boolean validateHeaders, AsciiString... otherHeaders)
Used to create read only object designed to represent trailers.If this is used for a purpose other than trailers you may violate the header serialization ordering defined by RFC 7540, 8.1.2.1.
- Parameters:
validateHeaders
-true
will run validation on each header name/value pair to ensure protocol compliance.otherHeaders
- An array of key:value pairs. Must not contain any pseudo headers ornull
names/values. A copy will NOT be made of this array. If the contents of this array may be modified externally you are responsible for passing in a copy.- Returns:
- A read only representation of the headers.
-
clientHeaders
public static ReadOnlyHttp2Headers clientHeaders(boolean validateHeaders, AsciiString method, AsciiString path, AsciiString scheme, AsciiString authority, AsciiString... otherHeaders)
Create a new read only representation of headers used by clients.- Parameters:
validateHeaders
-true
will run validation on each header name/value pair to ensure protocol compliance.method
- The value forHttp2Headers.PseudoHeaderName.METHOD
.path
- The value forHttp2Headers.PseudoHeaderName.PATH
.scheme
- The value forHttp2Headers.PseudoHeaderName.SCHEME
.authority
- The value forHttp2Headers.PseudoHeaderName.AUTHORITY
.otherHeaders
- An array of key:value pairs. Must not contain any pseudo headers ornull
names/values. A copy will NOT be made of this array. If the contents of this array may be modified externally you are responsible for passing in a copy.- Returns:
- a new read only representation of headers used by clients.
-
serverHeaders
public static ReadOnlyHttp2Headers serverHeaders(boolean validateHeaders, AsciiString status, AsciiString... otherHeaders)
Create a new read only representation of headers used by servers.- Parameters:
validateHeaders
-true
will run validation on each header name/value pair to ensure protocol compliance.status
- The value forHttp2Headers.PseudoHeaderName.STATUS
.otherHeaders
- An array of key:value pairs. Must not contain any pseudo headers ornull
names/values. A copy will NOT be made of this array. If the contents of this array may be modified externally you are responsible for passing in a copy.- Returns:
- a new read only representation of headers used by servers.
-
get
public CharSequence get(CharSequence name)
Description copied from interface:Headers
Returns the value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
get
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the first header value if the header is found.
null
if there's no such header
-
get
public CharSequence get(CharSequence name, CharSequence defaultValue)
Description copied from interface:Headers
Returns the value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
get
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the first header value or
defaultValue
if there is no such header
-
getAndRemove
public CharSequence getAndRemove(CharSequence name)
Description copied from interface:Headers
Returns the value of a header with the specified name and removes it from this object. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the first header value or
null
if there is no such header
-
getAndRemove
public CharSequence getAndRemove(CharSequence name, CharSequence defaultValue)
Description copied from interface:Headers
Returns the value of a header with the specified name and removes it from this object. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the first header value or
defaultValue
if there is no such header
-
getAll
public List<CharSequence> getAll(CharSequence name)
Description copied from interface:Headers
Returns all values for the header with the specified name. The returnedList
can't be modified.- Specified by:
getAll
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- a
List
of header values or an emptyList
if no values are found.
-
getAllAndRemove
public List<CharSequence> getAllAndRemove(CharSequence name)
Description copied from interface:Headers
Returns all values for the header with the specified name and removes them from this object. The returnedList
can't be modified.- Specified by:
getAllAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- a
List
of header values or an emptyList
if no values are found.
-
getBoolean
public Boolean getBoolean(CharSequence name)
Description copied from interface:Headers
Returns theboolean
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getBoolean
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the
boolean
value of the first value in insertion order ornull
if there is no such value or it can't be converted toboolean
.
-
getBoolean
public boolean getBoolean(CharSequence name, boolean defaultValue)
Description copied from interface:Headers
Returns theboolean
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getBoolean
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
boolean
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toboolean
.
-
getByte
public Byte getByte(CharSequence name)
Description copied from interface:Headers
Returns thebyte
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getByte
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the
byte
value of the first value in insertion order ornull
if there is no such value or it can't be converted tobyte
.
-
getByte
public byte getByte(CharSequence name, byte defaultValue)
Description copied from interface:Headers
Returns thebyte
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getByte
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
byte
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tobyte
.
-
getChar
public Character getChar(CharSequence name)
Description copied from interface:Headers
Returns thechar
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getChar
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the
char
value of the first value in insertion order ornull
if there is no such value or it can't be converted tochar
.
-
getChar
public char getChar(CharSequence name, char defaultValue)
Description copied from interface:Headers
Returns thechar
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getChar
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
char
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tochar
.
-
getShort
public Short getShort(CharSequence name)
Description copied from interface:Headers
Returns theshort
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getShort
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the
short
value of the first value in insertion order ornull
if there is no such value or it can't be converted toshort
.
-
getShort
public short getShort(CharSequence name, short defaultValue)
Description copied from interface:Headers
Returns theshort
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getShort
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
short
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toshort
.
-
getInt
public Integer getInt(CharSequence name)
Description copied from interface:Headers
Returns theint
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getInt
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the
int
value of the first value in insertion order ornull
if there is no such value or it can't be converted toint
.
-
getInt
public int getInt(CharSequence name, int defaultValue)
Description copied from interface:Headers
Returns theint
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getInt
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
int
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toint
.
-
getLong
public Long getLong(CharSequence name)
Description copied from interface:Headers
Returns thelong
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getLong
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the
long
value of the first value in insertion order ornull
if there is no such value or it can't be converted tolong
.
-
getLong
public long getLong(CharSequence name, long defaultValue)
Description copied from interface:Headers
Returns thelong
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getLong
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
long
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tolong
.
-
getFloat
public Float getFloat(CharSequence name)
Description copied from interface:Headers
Returns thefloat
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getFloat
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the
float
value of the first value in insertion order ornull
if there is no such value or it can't be converted tofloat
.
-
getFloat
public float getFloat(CharSequence name, float defaultValue)
Description copied from interface:Headers
Returns thefloat
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getFloat
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
float
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tofloat
.
-
getDouble
public Double getDouble(CharSequence name)
Description copied from interface:Headers
Returns thedouble
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getDouble
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the
double
value of the first value in insertion order ornull
if there is no such value or it can't be converted todouble
.
-
getDouble
public double getDouble(CharSequence name, double defaultValue)
Description copied from interface:Headers
Returns thedouble
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getDouble
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
double
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted todouble
.
-
getTimeMillis
public Long getTimeMillis(CharSequence name)
Description copied from interface:Headers
Returns the value of a header with the specified name in milliseconds. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getTimeMillis
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the milliseconds value of the first value in insertion order or
null
if there is no such value or it can't be converted to milliseconds.
-
getTimeMillis
public long getTimeMillis(CharSequence name, long defaultValue)
Description copied from interface:Headers
Returns the value of a header with the specified name in milliseconds. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getTimeMillis
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the milliseconds value of the first value in insertion order or
defaultValue
if there is no such value or it can't be converted to milliseconds.
-
getBooleanAndRemove
public Boolean getBooleanAndRemove(CharSequence name)
Description copied from interface:Headers
Returns theboolean
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getBooleanAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the
boolean
value of the first value in insertion order ornull
if there is no such value or it can't be converted toboolean
.
-
getBooleanAndRemove
public boolean getBooleanAndRemove(CharSequence name, boolean defaultValue)
Description copied from interface:Headers
Returns theboolean
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getBooleanAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
boolean
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toboolean
.
-
getByteAndRemove
public Byte getByteAndRemove(CharSequence name)
Description copied from interface:Headers
Returns thebyte
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getByteAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to search- Returns:
- the
byte
value of the first value in insertion order ornull
if there is no such value or it can't be converted tobyte
.
-
getByteAndRemove
public byte getByteAndRemove(CharSequence name, byte defaultValue)
Description copied from interface:Headers
Returns thebyte
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getByteAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
byte
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tobyte
.
-
getCharAndRemove
public Character getCharAndRemove(CharSequence name)
Description copied from interface:Headers
Returns thechar
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getCharAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to search- Returns:
- the
char
value of the first value in insertion order ornull
if there is no such value or it can't be converted tochar
.
-
getCharAndRemove
public char getCharAndRemove(CharSequence name, char defaultValue)
Description copied from interface:Headers
Returns thechar
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getCharAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
char
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tochar
.
-
getShortAndRemove
public Short getShortAndRemove(CharSequence name)
Description copied from interface:Headers
Returns theshort
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getShortAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to search- Returns:
- the
short
value of the first value in insertion order ornull
if there is no such value or it can't be converted toshort
.
-
getShortAndRemove
public short getShortAndRemove(CharSequence name, short defaultValue)
Description copied from interface:Headers
Returns theshort
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getShortAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
short
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toshort
.
-
getIntAndRemove
public Integer getIntAndRemove(CharSequence name)
Description copied from interface:Headers
Returns theint
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getIntAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to search- Returns:
- the
int
value of the first value in insertion order ornull
if there is no such value or it can't be converted toint
.
-
getIntAndRemove
public int getIntAndRemove(CharSequence name, int defaultValue)
Description copied from interface:Headers
Returns theint
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getIntAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
int
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toint
.
-
getLongAndRemove
public Long getLongAndRemove(CharSequence name)
Description copied from interface:Headers
Returns thelong
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getLongAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to search- Returns:
- the
long
value of the first value in insertion order ornull
if there is no such value or it can't be converted tolong
.
-
getLongAndRemove
public long getLongAndRemove(CharSequence name, long defaultValue)
Description copied from interface:Headers
Returns thelong
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getLongAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
long
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tolong
.
-
getFloatAndRemove
public Float getFloatAndRemove(CharSequence name)
Description copied from interface:Headers
Returns thefloat
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getFloatAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to search- Returns:
- the
float
value of the first value in insertion order ornull
if there is no such value or it can't be converted tofloat
.
-
getFloatAndRemove
public float getFloatAndRemove(CharSequence name, float defaultValue)
Description copied from interface:Headers
Returns thefloat
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getFloatAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
float
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tofloat
.
-
getDoubleAndRemove
public Double getDoubleAndRemove(CharSequence name)
Description copied from interface:Headers
Returns thedouble
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getDoubleAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to search- Returns:
- the
double
value of the first value in insertion order ornull
if there is no such value or it can't be converted todouble
.
-
getDoubleAndRemove
public double getDoubleAndRemove(CharSequence name, double defaultValue)
Description copied from interface:Headers
Returns thedouble
value of a header with the specifiedname
and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getDoubleAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
double
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted todouble
.
-
getTimeMillisAndRemove
public Long getTimeMillisAndRemove(CharSequence name)
Description copied from interface:Headers
Returns the value of a header with the specifiedname
in milliseconds and removes the header from this object. If there is more than one value for the specifiedname
, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getTimeMillisAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrieve- Returns:
- the milliseconds value of the first value in insertion order or
null
if there is no such value or it can't be converted to milliseconds.
-
getTimeMillisAndRemove
public long getTimeMillisAndRemove(CharSequence name, long defaultValue)
Description copied from interface:Headers
Returns the value of a header with the specifiedname
in milliseconds and removes the header from this object. If there is more than one value for the specifiedname
, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getTimeMillisAndRemove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the milliseconds value of the first value in insertion order or
defaultValue
if there is no such value or it can't be converted to milliseconds.
-
contains
public boolean contains(CharSequence name)
Description copied from interface:Headers
Returnstrue
if a header with thename
exists,false
otherwise.- Specified by:
contains
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header name
-
contains
public boolean contains(CharSequence name, CharSequence value)
Description copied from interface:Headers
Returnstrue
if a header with thename
andvalue
exists,false
otherwise.The
Object.equals(Object)
method is used to test for equality ofvalue
.- Specified by:
contains
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value of the header to find
-
containsObject
public boolean containsObject(CharSequence name, Object value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsObject
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
containsBoolean
public boolean containsBoolean(CharSequence name, boolean value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsBoolean
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
containsByte
public boolean containsByte(CharSequence name, byte value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsByte
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
containsChar
public boolean containsChar(CharSequence name, char value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsChar
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
containsShort
public boolean containsShort(CharSequence name, short value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsShort
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
containsInt
public boolean containsInt(CharSequence name, int value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsInt
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
containsLong
public boolean containsLong(CharSequence name, long value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsLong
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
containsFloat
public boolean containsFloat(CharSequence name, float value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsFloat
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
containsDouble
public boolean containsDouble(CharSequence name, double value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsDouble
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
containsTimeMillis
public boolean containsTimeMillis(CharSequence name, long value)
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists.- Specified by:
containsTimeMillis
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the header value- Returns:
true
if it contains itfalse
otherwise
-
size
public int size()
Description copied from interface:Headers
Returns the number of headers in this object.- Specified by:
size
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
-
isEmpty
public boolean isEmpty()
Description copied from interface:Headers
- Specified by:
isEmpty
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
-
names
public Set<CharSequence> names()
Description copied from interface:Headers
- Specified by:
names
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
-
add
public Http2Headers add(CharSequence name, CharSequence value)
Description copied from interface:Headers
Adds a new header with the specifiedname
andvalue
.- Specified by:
add
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the name of the headervalue
- the value of the header- Returns:
this
-
add
public Http2Headers add(CharSequence name, Iterable<? extends CharSequence> values)
Description copied from interface:Headers
Adds new headers with the specifiedname
andvalues
. This method is semantically equivalent tofor (T value : values) { headers.add(name, value); }
- Specified by:
add
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalues
- the values of the header- Returns:
this
-
add
public Http2Headers add(CharSequence name, CharSequence... values)
Description copied from interface:Headers
Adds new headers with the specifiedname
andvalues
. This method is semantically equivalent tofor (T value : values) { headers.add(name, value); }
- Specified by:
add
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalues
- the values of the header- Returns:
this
-
addObject
public Http2Headers addObject(CharSequence name, Object value)
Description copied from interface:Headers
Adds a new header. Before thevalue
is added, it's converted to typeT
.- Specified by:
addObject
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
addObject
public Http2Headers addObject(CharSequence name, Iterable<?> values)
Description copied from interface:Headers
Adds a new header with the specified name and values. This method is equivalent tofor (Object v : values) { headers.addObject(name, v); }
- Specified by:
addObject
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalues
- the value of the header- Returns:
this
-
addObject
public Http2Headers addObject(CharSequence name, Object... values)
Description copied from interface:Headers
Adds a new header with the specified name and values. This method is equivalent tofor (Object v : values) { headers.addObject(name, v); }
- Specified by:
addObject
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalues
- the value of the header- Returns:
this
-
addBoolean
public Http2Headers addBoolean(CharSequence name, boolean value)
Description copied from interface:Headers
Adds a new header.- Specified by:
addBoolean
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
addByte
public Http2Headers addByte(CharSequence name, byte value)
Description copied from interface:Headers
Adds a new header.- Specified by:
addByte
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
addChar
public Http2Headers addChar(CharSequence name, char value)
Description copied from interface:Headers
Adds a new header.- Specified by:
addChar
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
addShort
public Http2Headers addShort(CharSequence name, short value)
Description copied from interface:Headers
Adds a new header.- Specified by:
addShort
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
addInt
public Http2Headers addInt(CharSequence name, int value)
Description copied from interface:Headers
Adds a new header.- Specified by:
addInt
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
addLong
public Http2Headers addLong(CharSequence name, long value)
Description copied from interface:Headers
Adds a new header.- Specified by:
addLong
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
addFloat
public Http2Headers addFloat(CharSequence name, float value)
Description copied from interface:Headers
Adds a new header.- Specified by:
addFloat
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
addDouble
public Http2Headers addDouble(CharSequence name, double value)
Description copied from interface:Headers
Adds a new header.- Specified by:
addDouble
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
addTimeMillis
public Http2Headers addTimeMillis(CharSequence name, long value)
Description copied from interface:Headers
Adds a new header.- Specified by:
addTimeMillis
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
add
public Http2Headers add(Headers<? extends CharSequence,? extends CharSequence,?> headers)
Description copied from interface:Headers
Adds all header names and values ofheaders
to this object.- Specified by:
add
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Returns:
this
-
set
public Http2Headers set(CharSequence name, CharSequence value)
Description copied from interface:Headers
Sets a header with the specified name and value. Any existing headers with the same name are overwritten.- Specified by:
set
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
set
public Http2Headers set(CharSequence name, Iterable<? extends CharSequence> values)
Description copied from interface:Headers
Sets a new header with the specified name and values. This method is equivalent tofor (T v : values) { headers.addObject(name, v); }
- Specified by:
set
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalues
- the value of the header- Returns:
this
-
set
public Http2Headers set(CharSequence name, CharSequence... values)
Description copied from interface:Headers
Sets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:headers.remove(name); for (T v : values) { headers.add(name, v); }
- Specified by:
set
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalues
- the value of the header- Returns:
this
-
setObject
public Http2Headers setObject(CharSequence name, Object value)
Description copied from interface:Headers
Sets a new header. Any existing headers with this name are removed. Before thevalue
is add, it's converted to typeT
.- Specified by:
setObject
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalue
- the value of the header- Returns:
this
-
setObject
public Http2Headers setObject(CharSequence name, Iterable<?> values)
Description copied from interface:Headers
Sets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:headers.remove(name); for (Object v : values) { headers.addObject(name, v); }
- Specified by:
setObject
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalues
- the values of the header- Returns:
this
-
setObject
public Http2Headers setObject(CharSequence name, Object... values)
Description copied from interface:Headers
Sets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:headers.remove(name); for (Object v : values) { headers.addObject(name, v); }
- Specified by:
setObject
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header namevalues
- the values of the header- Returns:
this
-
setBoolean
public Http2Headers setBoolean(CharSequence name, boolean value)
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setBoolean
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
setByte
public Http2Headers setByte(CharSequence name, byte value)
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setByte
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
setChar
public Http2Headers setChar(CharSequence name, char value)
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setChar
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
setShort
public Http2Headers setShort(CharSequence name, short value)
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setShort
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
setInt
public Http2Headers setInt(CharSequence name, int value)
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setInt
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
setLong
public Http2Headers setLong(CharSequence name, long value)
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setLong
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
setFloat
public Http2Headers setFloat(CharSequence name, float value)
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setFloat
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
setDouble
public Http2Headers setDouble(CharSequence name, double value)
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setDouble
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
setTimeMillis
public Http2Headers setTimeMillis(CharSequence name, long value)
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setTimeMillis
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
set
public Http2Headers set(Headers<? extends CharSequence,? extends CharSequence,?> headers)
Description copied from interface:Headers
Clears the current header entries and copies all header entries of the specifiedheaders
.- Specified by:
set
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Returns:
this
-
setAll
public Http2Headers setAll(Headers<? extends CharSequence,? extends CharSequence,?> headers)
Description copied from interface:Headers
Retains all current headers but calls#set(K, V)
for each entry inheaders
.- Specified by:
setAll
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
headers
- The headers used to#set(K, V)
values in this instance- Returns:
this
-
remove
public boolean remove(CharSequence name)
Description copied from interface:Headers
Removes all headers with the specifiedname
.- Specified by:
remove
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Parameters:
name
- the header name- Returns:
true
if at least one entry has been removed.
-
clear
public Http2Headers clear()
Description copied from interface:Headers
Removes all headers. After a call to this methodHeaders.size()
equals0
.- Specified by:
clear
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Returns:
this
-
iterator
public Iterator<Map.Entry<CharSequence,CharSequence>> iterator()
Description copied from interface:Http2Headers
Returns an iterator over all HTTP/2 headers. The iteration order is as follows: 1. All pseudo headers (order not specified). 2. All non-pseudo headers (in insertion order).- Specified by:
iterator
in interfaceHeaders<CharSequence,CharSequence,Http2Headers>
- Specified by:
iterator
in interfaceHttp2Headers
- Specified by:
iterator
in interfaceIterable<Map.Entry<CharSequence,CharSequence>>
-
valueIterator
public Iterator<CharSequence> valueIterator(CharSequence name)
Description copied from interface:Http2Headers
Equivalent toHeaders.getAll(Object)
but no intermediate list is generated.- Specified by:
valueIterator
in interfaceHttp2Headers
- Parameters:
name
- the name of the header to retrieve- Returns:
- an
Iterator
of header values corresponding toname
.
-
method
public Http2Headers method(CharSequence value)
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.METHOD
header- Specified by:
method
in interfaceHttp2Headers
-
scheme
public Http2Headers scheme(CharSequence value)
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.SCHEME
header- Specified by:
scheme
in interfaceHttp2Headers
-
authority
public Http2Headers authority(CharSequence value)
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.AUTHORITY
header- Specified by:
authority
in interfaceHttp2Headers
-
path
public Http2Headers path(CharSequence value)
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.PATH
header- Specified by:
path
in interfaceHttp2Headers
-
status
public Http2Headers status(CharSequence value)
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.STATUS
header- Specified by:
status
in interfaceHttp2Headers
-
method
public CharSequence method()
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.METHOD
header ornull
if there is no such header- Specified by:
method
in interfaceHttp2Headers
-
scheme
public CharSequence scheme()
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.SCHEME
header ornull
if there is no such header- Specified by:
scheme
in interfaceHttp2Headers
-
authority
public CharSequence authority()
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.AUTHORITY
header ornull
if there is no such header- Specified by:
authority
in interfaceHttp2Headers
-
path
public CharSequence path()
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.PATH
header ornull
if there is no such header- Specified by:
path
in interfaceHttp2Headers
-
status
public CharSequence status()
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.STATUS
header ornull
if there is no such header- Specified by:
status
in interfaceHttp2Headers
-
contains
public boolean contains(CharSequence name, CharSequence value, boolean caseInsensitive)
Description copied from interface:Http2Headers
Returnstrue
if a header with thename
andvalue
exists,false
otherwise.If
caseInsensitive
istrue
then a case insensitive compare is done on the value.- Specified by:
contains
in interfaceHttp2Headers
- Parameters:
name
- the name of the header to findvalue
- the value of the header to findcaseInsensitive
-true
then a case insensitive compare is run to compare values. otherwise a case sensitive compare is run to compare values.
-
-