public class DefaultHttp2Headers extends DefaultBinaryHeaders implements Http2Headers
DefaultHeaders.HashCodeGenerator<T>, DefaultHeaders.IdentityNameConverter<T>, DefaultHeaders.KeyValueHeaderIterator, DefaultHeaders.NameConverter<T>
Http2Headers.PseudoHeaderName
BinaryHeaders.EntryVisitor, BinaryHeaders.NameVisitor
Headers.ValueConverter<T>
Constructor and Description |
---|
DefaultHttp2Headers()
Creates an instance that will convert all header names to lowercase.
|
DefaultHttp2Headers(boolean forceKeyToLower)
Creates an instance that can be configured to either do header field name conversion to
lowercase, or not do any conversion at all.
|
Modifier and Type | Method and Description |
---|---|
Http2Headers |
add(AsciiString name,
AsciiString... values)
Adds a new header with the specified name and values.
|
Http2Headers |
add(AsciiString name,
AsciiString value)
Adds a new header with the specified name and value.
|
Http2Headers |
add(AsciiString name,
Iterable<? extends AsciiString> values)
Adds a new header with the specified name and values.
|
Http2Headers |
add(BinaryHeaders headers)
|
Http2Headers |
addBoolean(AsciiString name,
boolean value)
Add the
name to value . |
Http2Headers |
addByte(AsciiString name,
byte value)
Add the
name to value . |
Http2Headers |
addChar(AsciiString name,
char value)
Add the
name to value . |
Http2Headers |
addDouble(AsciiString name,
double value)
Add the
name to value . |
Http2Headers |
addFloat(AsciiString name,
float value)
Add the
name to value . |
Http2Headers |
addInt(AsciiString name,
int value)
Add the
name to value . |
Http2Headers |
addLong(AsciiString name,
long value)
Add the
name to value . |
Http2Headers |
addObject(AsciiString name,
Iterable<?> values)
Adds a new header with the specified name and values.
|
Http2Headers |
addObject(AsciiString name,
Object... values)
Adds a new header with the specified name and values.
|
Http2Headers |
addObject(AsciiString name,
Object value)
Adds a new header with the specified name and value.
|
Http2Headers |
addShort(AsciiString name,
short value)
Add the
name to value . |
Http2Headers |
addTimeMillis(AsciiString name,
long value)
Add the
name to value . |
AsciiString |
authority()
Gets the
Http2Headers.PseudoHeaderName.AUTHORITY header or null if there is no such header |
Http2Headers |
authority(AsciiString value)
Sets the
Http2Headers.PseudoHeaderName.AUTHORITY header or null if there is no such header |
Http2Headers |
clear()
Removes all headers.
|
AsciiString |
method()
Gets the
Http2Headers.PseudoHeaderName.METHOD header or null if there is no such header |
Http2Headers |
method(AsciiString value)
Sets the
Http2Headers.PseudoHeaderName.METHOD header or null if there is no such header |
AsciiString |
path()
Gets the
Http2Headers.PseudoHeaderName.PATH header or null if there is no such header |
Http2Headers |
path(AsciiString value)
Sets the
Http2Headers.PseudoHeaderName.PATH header or null if there is no such header |
AsciiString |
scheme()
Gets the
Http2Headers.PseudoHeaderName.SCHEME header or null if there is no such header |
Http2Headers |
scheme(AsciiString value)
Sets the
Http2Headers.PseudoHeaderName.SCHEME header if there is no such header |
Http2Headers |
set(AsciiString name,
AsciiString... values)
Sets a header with the specified name and values.
|
Http2Headers |
set(AsciiString name,
AsciiString value)
Sets a header with the specified name and value.
|
Http2Headers |
set(AsciiString name,
Iterable<? extends AsciiString> values)
Sets a header with the specified name and values.
|
Http2Headers |
set(BinaryHeaders headers)
|
Http2Headers |
setAll(BinaryHeaders headers)
|
Http2Headers |
setBoolean(AsciiString name,
boolean value)
Set the
name to value . |
Http2Headers |
setByte(AsciiString name,
byte value)
Set the
name to value . |
Http2Headers |
setChar(AsciiString name,
char value)
Set the
name to value . |
Http2Headers |
setDouble(AsciiString name,
double value)
Set the
name to value . |
Http2Headers |
setFloat(AsciiString name,
float value)
Set the
name to value . |
Http2Headers |
setInt(AsciiString name,
int value)
Set the
name to value . |
Http2Headers |
setLong(AsciiString name,
long value)
Set the
name to value . |
Http2Headers |
setObject(AsciiString name,
Iterable<?> values)
Sets a header with the specified name and values.
|
Http2Headers |
setObject(AsciiString name,
Object... values)
Sets a header with the specified name and values.
|
Http2Headers |
setObject(AsciiString name,
Object value)
Sets a header with the specified name and value.
|
Http2Headers |
setShort(AsciiString name,
short value)
Set the
name to value . |
Http2Headers |
setTimeMillis(AsciiString name,
long value)
Set the
name to value . |
AsciiString |
status()
Gets the
Http2Headers.PseudoHeaderName.STATUS header or null if there is no such header |
Http2Headers |
status(AsciiString value)
Sets the
Http2Headers.PseudoHeaderName.STATUS header or null if there is no such header |
add, contains, contains, contains, contains, containsBoolean, containsByte, containsChar, containsDouble, containsFloat, containsInt, containsLong, containsObject, containsObject, containsObject, containsShort, containsTimeMillis, entries, equals, forEachEntry, forEachName, get, get, getAll, getAllAndRemove, getAndRemove, getAndRemove, getBoolean, getBoolean, getBooleanAndRemove, getBooleanAndRemove, getByte, getByte, getByteAndRemove, getByteAndRemove, getChar, getChar, getCharAndRemove, getCharAndRemove, getDouble, getDouble, getDoubleAndRemove, getDoubleAndRemove, getFloat, getFloat, getFloatAndRemove, getFloatAndRemove, getInt, getInt, getInt, getIntAndRemove, getIntAndRemove, getLong, getLong, getLongAndRemove, getLongAndRemove, getShort, getShortAndRemove, getShortAndRemove, getTimeMillis, getTimeMillis, getTimeMillisAndRemove, getTimeMillisAndRemove, hashCode, isEmpty, iterator, names, namesList, remove, set, setAll, size, toString, valueConverter
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, contains, contains, contains, contains, containsBoolean, containsByte, containsChar, containsDouble, containsFloat, containsInt, containsLong, containsObject, containsObject, containsObject, containsShort, containsTimeMillis, entries, forEachEntry, forEachName, get, get, getAll, getAllAndRemove, getAndRemove, getAndRemove, getBoolean, getBoolean, getBooleanAndRemove, getBooleanAndRemove, getByte, getByte, getByteAndRemove, getByteAndRemove, getChar, getChar, getCharAndRemove, getCharAndRemove, getDouble, getDouble, getDoubleAndRemove, getDoubleAndRemove, getFloat, getFloat, getFloatAndRemove, getFloatAndRemove, getInt, getInt, getInt, getIntAndRemove, getIntAndRemove, getLong, getLong, getLongAndRemove, getLongAndRemove, getShort, getShortAndRemove, getShortAndRemove, getTimeMillis, getTimeMillis, getTimeMillisAndRemove, getTimeMillisAndRemove, isEmpty, iterator, names, namesList, remove, set, setAll, size
public DefaultHttp2Headers()
public DefaultHttp2Headers(boolean forceKeyToLower)
Note that setting forceKeyToLower
to false
can violate the
HTTP/2 specification
which specifies that a request or response containing an uppercase header field MUST be treated
as malformed. Only set forceKeyToLower
to false
if you are explicitly using lowercase
header field names and want to avoid the conversion to lowercase.
forceKeyToLower
- if @{code false} no header name conversion will be performedpublic Http2Headers add(AsciiString name, AsciiString value)
Headers
String
, it is
converted into a String
by Object.toString()
, except in the cases of Date
and
Calendar
, which are formatted to the date format defined in RFC2616.add
in interface BinaryHeaders
add
in interface Headers<AsciiString>
add
in interface Http2Headers
add
in class DefaultBinaryHeaders
name
- the name of the header being addedvalue
- the value of the header being addedthis
public Http2Headers add(AsciiString name, Iterable<? extends AsciiString> values)
Headers
for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
add
in interface BinaryHeaders
add
in interface Headers<AsciiString>
add
in interface Http2Headers
add
in class DefaultBinaryHeaders
name
- the name of the headepublic abstract rs being setvalues
- the values of the headers being setthis
public Http2Headers add(AsciiString name, AsciiString... values)
Headers
for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
add
in interface BinaryHeaders
add
in interface Headers<AsciiString>
add
in interface Http2Headers
add
in class DefaultBinaryHeaders
name
- the name of the headepublic abstract rs being setvalues
- the values of the headers being setthis
public Http2Headers addObject(AsciiString name, Object value)
Headers
String
, it is
converted into a String
by Object.toString()
, except in the cases of Date
and
Calendar
, which are formatted to the date format defined in RFC2616.addObject
in interface BinaryHeaders
addObject
in interface Headers<AsciiString>
addObject
in interface Http2Headers
addObject
in class DefaultBinaryHeaders
name
- the name of the header being addedvalue
- the value of the header being addedthis
public Http2Headers addObject(AsciiString name, Iterable<?> values)
Headers
for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
addObject
in interface BinaryHeaders
addObject
in interface Headers<AsciiString>
addObject
in interface Http2Headers
addObject
in class DefaultBinaryHeaders
name
- the name of the headepublic abstract rs being setvalues
- the values of the headers being setthis
public Http2Headers addObject(AsciiString name, Object... values)
Headers
for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
addObject
in interface BinaryHeaders
addObject
in interface Headers<AsciiString>
addObject
in interface Http2Headers
addObject
in class DefaultBinaryHeaders
name
- the name of the headepublic abstract rs being setvalues
- the values of the headers being setthis
public Http2Headers addBoolean(AsciiString name, boolean value)
Headers
name
to value
.addBoolean
in interface BinaryHeaders
addBoolean
in interface Headers<AsciiString>
addBoolean
in interface Http2Headers
addBoolean
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers addChar(AsciiString name, char value)
Headers
name
to value
.addChar
in interface BinaryHeaders
addChar
in interface Headers<AsciiString>
addChar
in interface Http2Headers
addChar
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers addByte(AsciiString name, byte value)
Headers
name
to value
.addByte
in interface BinaryHeaders
addByte
in interface Headers<AsciiString>
addByte
in interface Http2Headers
addByte
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers addShort(AsciiString name, short value)
Headers
name
to value
.addShort
in interface BinaryHeaders
addShort
in interface Headers<AsciiString>
addShort
in interface Http2Headers
addShort
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers addInt(AsciiString name, int value)
Headers
name
to value
.addInt
in interface BinaryHeaders
addInt
in interface Headers<AsciiString>
addInt
in interface Http2Headers
addInt
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers addLong(AsciiString name, long value)
Headers
name
to value
.addLong
in interface BinaryHeaders
addLong
in interface Headers<AsciiString>
addLong
in interface Http2Headers
addLong
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers addFloat(AsciiString name, float value)
Headers
name
to value
.addFloat
in interface BinaryHeaders
addFloat
in interface Headers<AsciiString>
addFloat
in interface Http2Headers
addFloat
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers addDouble(AsciiString name, double value)
Headers
name
to value
.addDouble
in interface BinaryHeaders
addDouble
in interface Headers<AsciiString>
addDouble
in interface Http2Headers
addDouble
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers addTimeMillis(AsciiString name, long value)
Headers
name
to value
.addTimeMillis
in interface BinaryHeaders
addTimeMillis
in interface Headers<AsciiString>
addTimeMillis
in interface Http2Headers
addTimeMillis
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers add(BinaryHeaders headers)
BinaryHeaders
add
in interface BinaryHeaders
add
in interface Http2Headers
add
in class DefaultBinaryHeaders
public Http2Headers set(AsciiString name, AsciiString value)
Headers
String
, it is converted into a String
by
Object.toString()
, except for Date
and Calendar
, which are formatted
to the date format defined in RFC2616.set
in interface BinaryHeaders
set
in interface Headers<AsciiString>
set
in interface Http2Headers
set
in class DefaultBinaryHeaders
name
- The name of the header being setvalue
- The value of the header being setthis
public Http2Headers set(AsciiString name, Iterable<? extends AsciiString> values)
Headers
headers.remove(name); for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
set
in interface BinaryHeaders
set
in interface Headers<AsciiString>
set
in interface Http2Headers
set
in class DefaultBinaryHeaders
name
- the name of the headers being setvalues
- the values of the headers being setthis
public Http2Headers set(AsciiString name, AsciiString... values)
Headers
headers.remove(name); for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
set
in interface BinaryHeaders
set
in interface Headers<AsciiString>
set
in interface Http2Headers
set
in class DefaultBinaryHeaders
name
- the name of the headers being setvalues
- the values of the headers being setthis
public Http2Headers setObject(AsciiString name, Object value)
Headers
String
, it is converted into a String
by
Object.toString()
, except for Date
and Calendar
, which are formatted
to the date format defined in RFC2616.setObject
in interface BinaryHeaders
setObject
in interface Headers<AsciiString>
setObject
in interface Http2Headers
setObject
in class DefaultBinaryHeaders
name
- The name of the header being setvalue
- The value of the header being setthis
public Http2Headers setObject(AsciiString name, Iterable<?> values)
Headers
headers.remove(name); for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
setObject
in interface BinaryHeaders
setObject
in interface Headers<AsciiString>
setObject
in interface Http2Headers
setObject
in class DefaultBinaryHeaders
name
- the name of the headers being setvalues
- the values of the headers being setthis
public Http2Headers setObject(AsciiString name, Object... values)
Headers
headers.remove(name); for (Object v : values) { if (v == null) { break; } headers.add(name, v); }
setObject
in interface BinaryHeaders
setObject
in interface Headers<AsciiString>
setObject
in interface Http2Headers
setObject
in class DefaultBinaryHeaders
name
- the name of the headers being setvalues
- the values of the headers being setthis
public Http2Headers setBoolean(AsciiString name, boolean value)
Headers
name
to value
. This will remove all previous values associated with name
.setBoolean
in interface BinaryHeaders
setBoolean
in interface Headers<AsciiString>
setBoolean
in interface Http2Headers
setBoolean
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers setChar(AsciiString name, char value)
Headers
name
to value
. This will remove all previous values associated with name
.setChar
in interface BinaryHeaders
setChar
in interface Headers<AsciiString>
setChar
in interface Http2Headers
setChar
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers setByte(AsciiString name, byte value)
Headers
name
to value
. This will remove all previous values associated with name
.setByte
in interface BinaryHeaders
setByte
in interface Headers<AsciiString>
setByte
in interface Http2Headers
setByte
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers setShort(AsciiString name, short value)
Headers
name
to value
. This will remove all previous values associated with name
.setShort
in interface BinaryHeaders
setShort
in interface Headers<AsciiString>
setShort
in interface Http2Headers
setShort
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers setInt(AsciiString name, int value)
Headers
name
to value
. This will remove all previous values associated with name
.setInt
in interface BinaryHeaders
setInt
in interface Headers<AsciiString>
setInt
in interface Http2Headers
setInt
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers setLong(AsciiString name, long value)
Headers
name
to value
. This will remove all previous values associated with name
.setLong
in interface BinaryHeaders
setLong
in interface Headers<AsciiString>
setLong
in interface Http2Headers
setLong
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers setFloat(AsciiString name, float value)
Headers
name
to value
. This will remove all previous values associated with name
.setFloat
in interface BinaryHeaders
setFloat
in interface Headers<AsciiString>
setFloat
in interface Http2Headers
setFloat
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers setDouble(AsciiString name, double value)
Headers
name
to value
. This will remove all previous values associated with name
.setDouble
in interface BinaryHeaders
setDouble
in interface Headers<AsciiString>
setDouble
in interface Http2Headers
setDouble
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers setTimeMillis(AsciiString name, long value)
Headers
name
to value
. This will remove all previous values associated with name
.setTimeMillis
in interface BinaryHeaders
setTimeMillis
in interface Headers<AsciiString>
setTimeMillis
in interface Http2Headers
setTimeMillis
in class DefaultBinaryHeaders
name
- The name to modifyvalue
- The valuethis
public Http2Headers set(BinaryHeaders headers)
BinaryHeaders
set
in interface BinaryHeaders
set
in interface Http2Headers
set
in class DefaultBinaryHeaders
public Http2Headers setAll(BinaryHeaders headers)
BinaryHeaders
setAll
in interface BinaryHeaders
setAll
in interface Http2Headers
setAll
in class DefaultBinaryHeaders
public Http2Headers clear()
Headers
clear
in interface BinaryHeaders
clear
in interface Headers<AsciiString>
clear
in interface Http2Headers
clear
in class DefaultBinaryHeaders
this
public Http2Headers method(AsciiString value)
Http2Headers
Http2Headers.PseudoHeaderName.METHOD
header or null
if there is no such headermethod
in interface Http2Headers
public Http2Headers scheme(AsciiString value)
Http2Headers
Http2Headers.PseudoHeaderName.SCHEME
header if there is no such headerscheme
in interface Http2Headers
public Http2Headers authority(AsciiString value)
Http2Headers
Http2Headers.PseudoHeaderName.AUTHORITY
header or null
if there is no such headerauthority
in interface Http2Headers
public Http2Headers path(AsciiString value)
Http2Headers
Http2Headers.PseudoHeaderName.PATH
header or null
if there is no such headerpath
in interface Http2Headers
public Http2Headers status(AsciiString value)
Http2Headers
Http2Headers.PseudoHeaderName.STATUS
header or null
if there is no such headerstatus
in interface Http2Headers
public AsciiString method()
Http2Headers
Http2Headers.PseudoHeaderName.METHOD
header or null
if there is no such headermethod
in interface Http2Headers
public AsciiString scheme()
Http2Headers
Http2Headers.PseudoHeaderName.SCHEME
header or null
if there is no such headerscheme
in interface Http2Headers
public AsciiString authority()
Http2Headers
Http2Headers.PseudoHeaderName.AUTHORITY
header or null
if there is no such headerauthority
in interface Http2Headers
public AsciiString path()
Http2Headers
Http2Headers.PseudoHeaderName.PATH
header or null
if there is no such headerpath
in interface Http2Headers
public AsciiString status()
Http2Headers
Http2Headers.PseudoHeaderName.STATUS
header or null
if there is no such headerstatus
in interface Http2Headers
Copyright © 2008–2015 The Netty Project. All rights reserved.