Package io.netty.handler.codec.http2
Class DefaultHttp2Headers
java.lang.Object
io.netty.handler.codec.DefaultHeaders<CharSequence,CharSequence,Http2Headers>
io.netty.handler.codec.http2.DefaultHttp2Headers
- All Implemented Interfaces:
Headers<CharSequence,
,CharSequence, Http2Headers> Http2Headers
,Iterable<Map.Entry<CharSequence,
CharSequence>>
public class DefaultHttp2Headers
extends DefaultHeaders<CharSequence,CharSequence,Http2Headers>
implements Http2Headers
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.netty.handler.codec.DefaultHeaders
DefaultHeaders.HeaderEntry<K,
V>, DefaultHeaders.NameValidator<K>, DefaultHeaders.ValueValidator<V> Nested classes/interfaces inherited from interface io.netty.handler.codec.http2.Http2Headers
Http2Headers.PseudoHeaderName
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final DefaultHeaders.NameValidator
<CharSequence> private static final ByteProcessor
private static final DefaultHeaders.ValueValidator
<CharSequence> Fields inherited from class io.netty.handler.codec.DefaultHeaders
head
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance.DefaultHttp2Headers
(boolean validate) Create a new instance.DefaultHttp2Headers
(boolean validate, boolean validateValues, int arraySizeHint) Create a new instance.DefaultHttp2Headers
(boolean validate, int arraySizeHint) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGets theHttp2Headers.PseudoHeaderName.AUTHORITY
header ornull
if there is no such headerauthority
(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.AUTHORITY
headerclear()
Removes all headers.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
int
hashCode()
method()
Gets theHttp2Headers.PseudoHeaderName.METHOD
header ornull
if there is no such headermethod
(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.METHOD
headerprotected final DefaultHeaders.HeaderEntry
<CharSequence, CharSequence> newHeaderEntry
(int h, CharSequence name, CharSequence value, DefaultHeaders.HeaderEntry<CharSequence, CharSequence> next) path()
Gets theHttp2Headers.PseudoHeaderName.PATH
header ornull
if there is no such headerpath
(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.PATH
headerscheme()
Gets theHttp2Headers.PseudoHeaderName.SCHEME
header ornull
if there is no such headerscheme
(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.SCHEME
headerstatus()
Gets theHttp2Headers.PseudoHeaderName.STATUS
header ornull
if there is no such headerstatus
(CharSequence value) Sets theHttp2Headers.PseudoHeaderName.STATUS
headerprotected void
validateName
(DefaultHeaders.NameValidator<CharSequence> validator, boolean forAdd, CharSequence name) Call out to the givenDefaultHeaders.NameValidator
to validate the given name.protected void
validateValue
(DefaultHeaders.ValueValidator<CharSequence> validator, CharSequence name, CharSequence value) Methods inherited from class io.netty.handler.codec.DefaultHeaders
add, add, add, add, addBoolean, addByte, addChar, addDouble, addFloat, addImpl, addInt, addLong, addObject, addObject, addObject, addShort, addTimeMillis, contains, contains, containsBoolean, containsByte, containsChar, containsDouble, containsFloat, containsInt, containsLong, containsObject, containsShort, containsTimeMillis, copy, equals, 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, getIntAndRemove, getIntAndRemove, getLong, getLong, getLongAndRemove, getLongAndRemove, getShort, getShort, getShortAndRemove, getShortAndRemove, getTimeMillis, getTimeMillis, getTimeMillisAndRemove, getTimeMillisAndRemove, hashCode, isEmpty, iterator, names, nameValidator, remove, set, set, set, set, setAll, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setObject, setObject, setObject, setShort, setTimeMillis, size, toString, valueConverter, valueIterator, valueValidator
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.netty.handler.codec.Headers
add, add, add, add, addBoolean, addByte, addChar, addDouble, addFloat, addInt, addLong, addObject, addObject, addObject, addShort, addTimeMillis, contains, containsBoolean, containsByte, containsChar, containsDouble, containsFloat, containsInt, containsLong, containsObject, containsShort, containsTimeMillis, 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, getIntAndRemove, getIntAndRemove, getLong, getLong, getLongAndRemove, getLongAndRemove, getShort, getShort, getShortAndRemove, getShortAndRemove, getTimeMillis, getTimeMillis, getTimeMillisAndRemove, getTimeMillisAndRemove, isEmpty, names, remove, set, set, set, set, setAll, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setObject, setObject, setObject, setShort, setTimeMillis, size
Methods inherited from interface io.netty.handler.codec.http2.Http2Headers
iterator, valueIterator
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
HTTP2_NAME_VALIDATOR_PROCESSOR
-
HTTP2_NAME_VALIDATOR
-
VALUE_VALIDATOR
-
firstNonPseudo
-
-
Constructor Details
-
DefaultHttp2Headers
public DefaultHttp2Headers()Create a new instance.Header names will be validated according to rfc7540.
-
DefaultHttp2Headers
public DefaultHttp2Headers(boolean validate) Create a new instance.- Parameters:
validate
-true
to validate header names according to rfc7540.false
to not validate header names.
-
DefaultHttp2Headers
public DefaultHttp2Headers(boolean validate, int arraySizeHint) Create a new instance.- Parameters:
validate
-true
to validate header names according to rfc7540.false
to not validate header names.arraySizeHint
- A hint as to how large the hash data structure should be. The next positive power of two will be used. An upper bound may be enforced.- See Also:
-
DefaultHttp2Headers
public DefaultHttp2Headers(boolean validate, boolean validateValues, int arraySizeHint) Create a new instance.- Parameters:
validate
-true
to validate header names according to rfc7540.false
to not validate header names.validateValues
-true
to validate header values according to rfc7230 and rfc5234. Otherwise,false
(the default) to not validate values.arraySizeHint
- A hint as to how large the hash data structure should be. The next positive power of two will be used. An upper bound may be enforced.
-
-
Method Details
-
validateName
protected void validateName(DefaultHeaders.NameValidator<CharSequence> validator, boolean forAdd, CharSequence name) Description copied from class:DefaultHeaders
Call out to the givenDefaultHeaders.NameValidator
to validate the given name.- Overrides:
validateName
in classDefaultHeaders<CharSequence,
CharSequence, Http2Headers> - Parameters:
validator
- the validator to useforAdd
-true
if this validation is for adding to the headers, orfalse
if this is for setting (overwriting) the given header.name
- the name to validate.
-
validateValue
protected void validateValue(DefaultHeaders.ValueValidator<CharSequence> validator, CharSequence name, CharSequence value) - Overrides:
validateValue
in classDefaultHeaders<CharSequence,
CharSequence, 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> - Overrides:
clear
in classDefaultHeaders<CharSequence,
CharSequence, Http2Headers> - Returns:
this
-
equals
- Overrides:
equals
in classDefaultHeaders<CharSequence,
CharSequence, Http2Headers>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classDefaultHeaders<CharSequence,
CharSequence, Http2Headers>
-
method
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.METHOD
header- Specified by:
method
in interfaceHttp2Headers
-
scheme
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.SCHEME
header- Specified by:
scheme
in interfaceHttp2Headers
-
authority
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.AUTHORITY
header- Specified by:
authority
in interfaceHttp2Headers
-
path
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.PATH
header- Specified by:
path
in interfaceHttp2Headers
-
status
Description copied from interface:Http2Headers
Sets theHttp2Headers.PseudoHeaderName.STATUS
header- Specified by:
status
in interfaceHttp2Headers
-
method
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.METHOD
header ornull
if there is no such header- Specified by:
method
in interfaceHttp2Headers
-
scheme
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.SCHEME
header ornull
if there is no such header- Specified by:
scheme
in interfaceHttp2Headers
-
authority
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.AUTHORITY
header ornull
if there is no such header- Specified by:
authority
in interfaceHttp2Headers
-
path
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.PATH
header ornull
if there is no such header- Specified by:
path
in interfaceHttp2Headers
-
status
Description copied from interface:Http2Headers
Gets theHttp2Headers.PseudoHeaderName.STATUS
header ornull
if there is no such header- Specified by:
status
in interfaceHttp2Headers
-
contains
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> - Overrides:
contains
in classDefaultHeaders<CharSequence,
CharSequence, Http2Headers> - Parameters:
name
- the header namevalue
- the header value of the header to find
-
contains
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.
-
newHeaderEntry
protected final DefaultHeaders.HeaderEntry<CharSequence,CharSequence> newHeaderEntry(int h, CharSequence name, CharSequence value, DefaultHeaders.HeaderEntry<CharSequence, CharSequence> next) - Overrides:
newHeaderEntry
in classDefaultHeaders<CharSequence,
CharSequence, Http2Headers>
-