Top Inners Fields Constructors Methods
io.netty.handler.codec.http2

public Class DefaultHttp2Headers

extends DefaultHeaders<CharSequence, CharSequence, Http2Headers>
implements Http2Headers
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.http2.Http2Headers, io.netty.handler.codec.Headers, java.lang.Iterable
Annotations
@UnstableApi
Imports
io.netty.handler.codec.CharSequenceValueConverter, .DefaultHeaders, io.netty.handler.codec.http.HttpHeaderValidationUtil, io.netty.util.AsciiString, .ByteProcessor, io.netty.util.internal.PlatformDependent, .UnstableApi

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private DefaultHeaders.HeaderEntry<CharSequence, CharSequence>
pack-priv static final DefaultHeaders.NameValidator<CharSequence>
private static final ByteProcessor
private static final DefaultHeaders.ValueValidator<CharSequence>
Inherited from io.netty.handler.codec.DefaultHeaders:
head

Constructor Summary

AccessConstructor and Description
public
DefaultHttp2Headers()

Create a new instance.

public
DefaultHttp2Headers(boolean
true to validate header names according to rfc7540. false to not validate header names.
validate
)

Create a new instance.

public
DefaultHttp2Headers(boolean
true to validate header names according to rfc7540. false to not validate header names.
validate
,
int
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.
arraySizeHint
)

Create a new instance.

public
DefaultHttp2Headers(boolean
true to validate header names according to rfc7540. false to not validate header names.
validate
,
boolean
true to validate header values according to rfc7230 and rfc5234. Otherwise, false (the default) to not validate values.
validateValues
,
int
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.
arraySizeHint
)

Create a new instance.

Method Summary

Modifier and TypeMethod and Description
public Http2Headers
public CharSequence
authority()

Implements io.netty.handler.codec.http2.Http2Headers.authority.

Gets the PseudoHeaderName#AUTHORITY header or null if there is no such header
public Http2Headers
public boolean
contains(CharSequence
the header name
name
,
CharSequence
the header value of the header to find
value
)

Overrides io.netty.handler.codec.DefaultHeaders.contains.

Implements io.netty.handler.codec.Headers.contains.

Returns true if a header with the name and value exists, false otherwise.
public boolean
contains(CharSequence
the name of the header to find
name
,
CharSequence
the value of the header to find
value
,
boolean
true then a case insensitive compare is run to compare values. otherwise a case sensitive compare is run to compare values.
caseInsensitive
)

Implements io.netty.handler.codec.http2.Http2Headers.contains.

Returns true if a header with the name and value exists, false otherwise.
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides io.netty.handler.codec.DefaultHeaders.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides io.netty.handler.codec.DefaultHeaders.hashCode.

Returns a hash code value for the object.
public Http2Headers
public CharSequence
method()

Implements io.netty.handler.codec.http2.Http2Headers.method.

Gets the PseudoHeaderName#METHOD header or null if there is no such header
protected final DefaultHeaders.HeaderEntry<CharSequence, CharSequence>
public Http2Headers
public CharSequence
path()

Implements io.netty.handler.codec.http2.Http2Headers.path.

Gets the PseudoHeaderName#PATH header or null if there is no such header
public Http2Headers
public CharSequence
scheme()

Implements io.netty.handler.codec.http2.Http2Headers.scheme.

Gets the PseudoHeaderName#SCHEME header or null if there is no such header
public Http2Headers
public CharSequence
status()

Implements io.netty.handler.codec.http2.Http2Headers.status.

Gets the PseudoHeaderName#STATUS header or null if there is no such header
protected void
validateName(DefaultHeaders.NameValidator<CharSequence>
the validator to use
validator
,
boolean
true if this validation is for adding to the headers, or false if this is for setting (overwriting) the given header.
forAdd
,
CharSequence
the name to validate.
name
)

Overrides io.netty.handler.codec.DefaultHeaders.validateName.

Call out to the given NameValidator to validate the given name.
protected void
Inherited from io.netty.handler.codec.DefaultHeaders:
addaddaddaddaddBooleanaddByteaddCharaddDoubleaddFloataddImpladdIntaddLongaddObjectaddObjectaddObjectaddShortaddTimeMilliscontainscontainscontainsBooleancontainsBytecontainsCharcontainsDoublecontainsFloatcontainsIntcontainsLongcontainsObjectcontainsShortcontainsTimeMilliscopyequalsgetgetgetAllgetAllAndRemovegetAndRemovegetAndRemovegetBooleangetBooleangetBooleanAndRemovegetBooleanAndRemovegetBytegetBytegetByteAndRemovegetByteAndRemovegetChargetChargetCharAndRemovegetCharAndRemovegetDoublegetDoublegetDoubleAndRemovegetDoubleAndRemovegetFloatgetFloatgetFloatAndRemovegetFloatAndRemovegetIntgetIntgetIntAndRemovegetIntAndRemovegetLonggetLonggetLongAndRemovegetLongAndRemovegetShortgetShortgetShortAndRemovegetShortAndRemovegetTimeMillisgetTimeMillisgetTimeMillisAndRemovegetTimeMillisAndRemovehashCodeisEmptyiteratornamesnameValidatorremovesetsetsetsetsetAllsetBooleansetBytesetCharsetDoublesetFloatsetIntsetLongsetObjectsetObjectsetObjectsetShortsetTimeMillissizetoStringvalueConvertervalueIteratorvalueValidator

Field Detail

firstNonPseudoback to summary
private DefaultHeaders.HeaderEntry<CharSequence, CharSequence> firstNonPseudo
HTTP2_NAME_VALIDATORback to summary
pack-priv static final DefaultHeaders.NameValidator<CharSequence> HTTP2_NAME_VALIDATOR
HTTP2_NAME_VALIDATOR_PROCESSORback to summary
private static final ByteProcessor HTTP2_NAME_VALIDATOR_PROCESSOR
VALUE_VALIDATORback to summary
private static final DefaultHeaders.ValueValidator<CharSequence> VALUE_VALIDATOR

Constructor Detail

DefaultHttp2Headersback to summary
public DefaultHttp2Headers()

Create a new instance.

Header names will be validated according to rfc7540.

DefaultHttp2Headersback to summary
public DefaultHttp2Headers(boolean validate)

Create a new instance.

Parameters
validate:boolean

true to validate header names according to rfc7540. false to not validate header names.

Annotations
@SuppressWarnings:unchecked
DefaultHttp2Headersback to summary
public DefaultHttp2Headers(boolean validate, int arraySizeHint)

Create a new instance.

Parameters
validate:boolean

true to validate header names according to rfc7540. false to not validate header names.

arraySizeHint:int

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.

Annotations
@SuppressWarnings:unchecked
See Also
DefaultHttp2Headers#DefaultHttp2Headers(boolean, boolean, int)
DefaultHttp2Headersback to summary
public DefaultHttp2Headers(boolean validate, boolean validateValues, int arraySizeHint)

Create a new instance.

Parameters
validate:boolean

true to validate header names according to rfc7540. false to not validate header names.

validateValues:boolean

true to validate header values according to rfc7230 and rfc5234. Otherwise, false (the default) to not validate values.

arraySizeHint:int

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.

Annotations
@SuppressWarnings:unchecked

Method Detail

authorityback to summary
public Http2Headers authority(CharSequence value)

Implements io.netty.handler.codec.http2.Http2Headers.authority.

Doc from io.netty.handler.codec.http2.Http2Headers.authority.

Sets the PseudoHeaderName#AUTHORITY header

Annotations
@Override
authorityback to summary
public CharSequence authority()

Implements io.netty.handler.codec.http2.Http2Headers.authority.

Doc from io.netty.handler.codec.http2.Http2Headers.authority.

Gets the PseudoHeaderName#AUTHORITY header or null if there is no such header

Annotations
@Override
clearback to summary
public Http2Headers clear()

Overrides io.netty.handler.codec.DefaultHeaders.clear.

Implements io.netty.handler.codec.Headers.clear.

Doc from io.netty.handler.codec.Headers.clear.

Removes all headers. After a call to this method size() equals 0.

Returns:Http2Headers

this

Annotations
@Override
containsback to summary
public boolean contains(CharSequence name, CharSequence value)

Overrides io.netty.handler.codec.DefaultHeaders.contains.

Implements io.netty.handler.codec.Headers.contains.

Doc from io.netty.handler.codec.Headers.contains.

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

The Object#equals(Object) method is used to test for equality of value.

Parameters
name:CharSequence

the header name

value:CharSequence

the header value of the header to find

Annotations
@Override
containsback to summary
public boolean contains(CharSequence name, CharSequence value, boolean caseInsensitive)

Implements io.netty.handler.codec.http2.Http2Headers.contains.

Doc from io.netty.handler.codec.http2.Http2Headers.contains.

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

If caseInsensitive is true then a case insensitive compare is done on the value.

Parameters
name:CharSequence

the name of the header to find

value:CharSequence

the value of the header to find

caseInsensitive:boolean

true then a case insensitive compare is run to compare values. otherwise a case sensitive compare is run to compare values.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides io.netty.handler.codec.DefaultHeaders.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides io.netty.handler.codec.DefaultHeaders.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
methodback to summary
public Http2Headers method(CharSequence value)

Implements io.netty.handler.codec.http2.Http2Headers.method.

Doc from io.netty.handler.codec.http2.Http2Headers.method.

Sets the PseudoHeaderName#METHOD header

Annotations
@Override
methodback to summary
public CharSequence method()

Implements io.netty.handler.codec.http2.Http2Headers.method.

Doc from io.netty.handler.codec.http2.Http2Headers.method.

Gets the PseudoHeaderName#METHOD header or null if there is no such header

Annotations
@Override
newHeaderEntryback to summary
protected final DefaultHeaders.HeaderEntry<CharSequence, CharSequence> newHeaderEntry(int h, CharSequence name, CharSequence value, DefaultHeaders.HeaderEntry<CharSequence, CharSequence> next)

Overrides io.netty.handler.codec.DefaultHeaders.newHeaderEntry.

Annotations
@Override
pathback to summary
public Http2Headers path(CharSequence value)

Implements io.netty.handler.codec.http2.Http2Headers.path.

Doc from io.netty.handler.codec.http2.Http2Headers.path.

Sets the PseudoHeaderName#PATH header

Annotations
@Override
pathback to summary
public CharSequence path()

Implements io.netty.handler.codec.http2.Http2Headers.path.

Doc from io.netty.handler.codec.http2.Http2Headers.path.

Gets the PseudoHeaderName#PATH header or null if there is no such header

Annotations
@Override
schemeback to summary
public Http2Headers scheme(CharSequence value)

Implements io.netty.handler.codec.http2.Http2Headers.scheme.

Doc from io.netty.handler.codec.http2.Http2Headers.scheme.

Sets the PseudoHeaderName#SCHEME header

Annotations
@Override
schemeback to summary
public CharSequence scheme()

Implements io.netty.handler.codec.http2.Http2Headers.scheme.

Doc from io.netty.handler.codec.http2.Http2Headers.scheme.

Gets the PseudoHeaderName#SCHEME header or null if there is no such header

Annotations
@Override
statusback to summary
public Http2Headers status(CharSequence value)

Implements io.netty.handler.codec.http2.Http2Headers.status.

Doc from io.netty.handler.codec.http2.Http2Headers.status.

Sets the PseudoHeaderName#STATUS header

Annotations
@Override
statusback to summary
public CharSequence status()

Implements io.netty.handler.codec.http2.Http2Headers.status.

Doc from io.netty.handler.codec.http2.Http2Headers.status.

Gets the PseudoHeaderName#STATUS header or null if there is no such header

Annotations
@Override
validateNameback to summary
protected void validateName(DefaultHeaders.NameValidator<CharSequence> validator, boolean forAdd, CharSequence name)

Overrides io.netty.handler.codec.DefaultHeaders.validateName.

Doc from io.netty.handler.codec.DefaultHeaders.validateName.

Call out to the given NameValidator to validate the given name.

Parameters
validator:DefaultHeaders.NameValidator<CharSequence>

the validator to use

forAdd:boolean

true if this validation is for adding to the headers, or false if this is for setting (overwriting) the given header.

name:CharSequence

the name to validate.

Annotations
@Override
validateValueback to summary
protected void validateValue(DefaultHeaders.ValueValidator<CharSequence> validator, CharSequence name, CharSequence value)

Overrides io.netty.handler.codec.DefaultHeaders.validateValue.

Annotations
@Override
io.netty.handler.codec.http2 back to summary

private final Class DefaultHttp2Headers.Http2HeaderEntry

extends DefaultHeaders.HeaderEntry<CharSequence, CharSequence>
Class Inheritance

Field Summary

Inherited from io.netty.handler.codec.DefaultHeaders.HeaderEntry:
afterbeforehashkeynextvalue

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
Inherited from io.netty.handler.codec.DefaultHeaders.HeaderEntry:
afterbeforeequalsgetKeygetValuehashCodepointNeighborsToThissetValuetoString

Constructor Detail

Http2HeaderEntryback to summary
pack-priv Http2HeaderEntry(int hash, CharSequence key, CharSequence value, DefaultHeaders.HeaderEntry<CharSequence, CharSequence> next)

Method Detail

removeback to summary
protected void remove()

Overrides io.netty.handler.codec.DefaultHeaders.HeaderEntry.remove.

Annotations
@Override