Top Description Inners Methods
io.netty.handler.codec.http2

public Interface Http2Headers

extends Headers<CharSequence, CharSequence, Http2Headers>
Known Direct Implementers
io.netty.handler.codec.http2.EmptyHttp2Headers, io.netty.handler.codec.http2.ReadOnlyHttp2Headers, io.netty.handler.codec.http2.DefaultHttp2Headers
Annotations
@UnstableApi
Imports
io.netty.handler.codec.Headers, io.netty.util.AsciiString, io.netty.util.internal.UnstableApi, java.util.Iterator, .Map.Entry

A collection of headers sent or received via HTTP/2.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Http2Headers.PseudoHeaderName

HTTP/2 pseudo-headers names.

Method Summary

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

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

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
)

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

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

Redeclares io.netty.handler.codec.Headers.iterator.

Returns an iterator over all HTTP/2 headers.
public Http2Headers
public CharSequence
method()

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

public Http2Headers
path(CharSequence value)

Sets the PseudoHeaderName#PATH header

public CharSequence
path()

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

public Http2Headers
public CharSequence
scheme()

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

public Http2Headers
public CharSequence
status()

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

public Iterator<CharSequence>

Returns:

an Iterator of header values corresponding to name.
valueIterator
(CharSequence
the name of the header to retrieve
name
)

Equivalent to getAll(Object) but no intermediate list is generated.

Inherited from io.netty.handler.codec.Headers:
addaddaddaddaddBooleanaddByteaddCharaddDoubleaddFloataddIntaddLongaddObjectaddObjectaddObjectaddShortaddTimeMillisclearcontainscontainscontainsBooleancontainsBytecontainsCharcontainsDoublecontainsFloatcontainsIntcontainsLongcontainsObjectcontainsShortcontainsTimeMillisgetgetgetAllgetAllAndRemovegetAndRemovegetAndRemovegetBooleangetBooleangetBooleanAndRemovegetBooleanAndRemovegetBytegetBytegetByteAndRemovegetByteAndRemovegetChargetChargetCharAndRemovegetCharAndRemovegetDoublegetDoublegetDoubleAndRemovegetDoubleAndRemovegetFloatgetFloatgetFloatAndRemovegetFloatAndRemovegetIntgetIntgetIntAndRemovegetIntAndRemovegetLonggetLonggetLongAndRemovegetLongAndRemovegetShortgetShortgetShortAndRemovegetShortAndRemovegetTimeMillisgetTimeMillisgetTimeMillisAndRemovegetTimeMillisAndRemoveisEmptynamesremovesetsetsetsetsetAllsetBooleansetBytesetCharsetDoublesetFloatsetIntsetLongsetObjectsetObjectsetObjectsetShortsetTimeMillissize

Method Detail

authorityback to summary
public Http2Headers authority(CharSequence value)

Sets the PseudoHeaderName#AUTHORITY header

authorityback to summary
public CharSequence authority()

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

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

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.

iteratorback to summary
public Iterator<Map.Entry<CharSequence, CharSequence>> iterator()

Redeclares io.netty.handler.codec.Headers.iterator.

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).

Returns:Iterator<Map.Entry<CharSequence, CharSequence>>

Doc from java.lang.Iterable.iterator.

an Iterator.

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

Sets the PseudoHeaderName#METHOD header

methodback to summary
public CharSequence method()

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

pathback to summary
public Http2Headers path(CharSequence value)

Sets the PseudoHeaderName#PATH header

pathback to summary
public CharSequence path()

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

schemeback to summary
public Http2Headers scheme(CharSequence value)

Sets the PseudoHeaderName#SCHEME header

schemeback to summary
public CharSequence scheme()

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

statusback to summary
public Http2Headers status(CharSequence value)

Sets the PseudoHeaderName#STATUS header

statusback to summary
public CharSequence status()

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

valueIteratorback to summary
public Iterator<CharSequence> valueIterator(CharSequence name)

Equivalent to getAll(Object) but no intermediate list is generated.

Parameters
name:CharSequence

the name of the header to retrieve

Returns:Iterator<CharSequence>

an Iterator of header values corresponding to name.

io.netty.handler.codec.http2 back to summary

public final Enum Http2Headers.PseudoHeaderName

extends Enum<Http2Headers.PseudoHeaderName>
Class Inheritance

HTTP/2 pseudo-headers names.

Field Summary

Modifier and TypeField and Description
public static final Http2Headers.PseudoHeaderName
AUTHORITY

:authority.

public static final Http2Headers.PseudoHeaderName
METHOD

:method.

public static final Http2Headers.PseudoHeaderName
PATH

:path.

public static final Http2Headers.PseudoHeaderName
private static final char
private static final byte
private final boolean
public static final Http2Headers.PseudoHeaderName
SCHEME

:scheme.

public static final Http2Headers.PseudoHeaderName
STATUS

:status.

private final AsciiString

Constructor Summary

AccessConstructor and Description
private
PseudoHeaderName(String value, boolean requestOnly)

Method Summary

Modifier and TypeMethod and Description
public static Http2Headers.PseudoHeaderName

Returns:

corresponding PseudoHeaderName if any, null otherwise.
getPseudoHeader
(CharSequence header)

Returns the PseudoHeaderName corresponding to the specified header name.

public static Http2Headers.PseudoHeaderName

Returns:

corresponding PseudoHeaderName if any, null otherwise.
getPseudoHeader
(AsciiString header)

Returns the PseudoHeaderName corresponding to the specified header name.

private static Http2Headers.PseudoHeaderName
public static boolean

Returns:

true if the header follow the pseudo-header format
hasPseudoHeaderFormat
(CharSequence headerName)

Indicates whether the specified header follows the pseudo-header format (begins with ':' character)

public static boolean
isPseudoHeader(CharSequence header)

Indicates whether the given header name is a valid HTTP/2 pseudo header.

public static boolean
isPseudoHeader(AsciiString header)

Indicates whether the given header name is a valid HTTP/2 pseudo header.

public static boolean
isPseudoHeader(String header)

Indicates whether the given header name is a valid HTTP/2 pseudo header.

public boolean

Returns:

true if the pseudo-header is to be used in a request context
isRequestOnly
()

Indicates whether the pseudo-header is to be used in a request context.

public AsciiString
public static Http2Headers.PseudoHeaderName
public static Http2Headers.PseudoHeaderName[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AUTHORITYback to summary
public static final Http2Headers.PseudoHeaderName AUTHORITY

:authority.

METHODback to summary
public static final Http2Headers.PseudoHeaderName METHOD

:method.

PATHback to summary
public static final Http2Headers.PseudoHeaderName PATH

:path.

PROTOCOLback to summary
public static final Http2Headers.PseudoHeaderName PROTOCOL

:protocol, as defined in RFC 8441, Bootstrapping WebSockets with HTTP/2.

PSEUDO_HEADER_PREFIXback to summary
private static final char PSEUDO_HEADER_PREFIX
PSEUDO_HEADER_PREFIX_BYTEback to summary
private static final byte PSEUDO_HEADER_PREFIX_BYTE
requestOnlyback to summary
private final boolean requestOnly
SCHEMEback to summary
public static final Http2Headers.PseudoHeaderName SCHEME

:scheme.

STATUSback to summary
public static final Http2Headers.PseudoHeaderName STATUS

:status.

valueback to summary
private final AsciiString value

Constructor Detail

PseudoHeaderNameback to summary
private PseudoHeaderName(String value, boolean requestOnly)

Method Detail

getPseudoHeaderback to summary
public static Http2Headers.PseudoHeaderName getPseudoHeader(CharSequence header)

Returns the PseudoHeaderName corresponding to the specified header name.

Returns:Http2Headers.PseudoHeaderName

corresponding PseudoHeaderName if any, null otherwise.

getPseudoHeaderback to summary
public static Http2Headers.PseudoHeaderName getPseudoHeader(AsciiString header)

Returns the PseudoHeaderName corresponding to the specified header name.

Returns:Http2Headers.PseudoHeaderName

corresponding PseudoHeaderName if any, null otherwise.

getPseudoHeaderNameback to summary
private static Http2Headers.PseudoHeaderName getPseudoHeaderName(CharSequence header)
hasPseudoHeaderFormatback to summary
public static boolean hasPseudoHeaderFormat(CharSequence headerName)

Indicates whether the specified header follows the pseudo-header format (begins with ':' character)

Returns:boolean

true if the header follow the pseudo-header format

isPseudoHeaderback to summary
public static boolean isPseudoHeader(CharSequence header)

Indicates whether the given header name is a valid HTTP/2 pseudo header.

isPseudoHeaderback to summary
public static boolean isPseudoHeader(AsciiString header)

Indicates whether the given header name is a valid HTTP/2 pseudo header.

isPseudoHeaderback to summary
public static boolean isPseudoHeader(String header)

Indicates whether the given header name is a valid HTTP/2 pseudo header.

isRequestOnlyback to summary
public boolean isRequestOnly()

Indicates whether the pseudo-header is to be used in a request context.

Returns:boolean

true if the pseudo-header is to be used in a request context

valueback to summary
public AsciiString value()
valueOfback to summary
public static Http2Headers.PseudoHeaderName valueOf(String name)
valuesback to summary
public static Http2Headers.PseudoHeaderName[] values()