Top Description Inners Methods
io.netty5.handler.codec.http2.headers

public Interface Http2Headers

extends HttpHeaders
Known Direct Implementers
io.netty5.handler.codec.http2.headers.DefaultHttp2Headers
Imports
io.netty5.handler.codec.http.headers.HttpCookiePair, .HttpHeaders, .HttpSetCookie, io.netty5.util.AsciiString, java.util.Iterator

HTTP/2 headers. This works similar to HttpHeaders with the following HTTP/2 specific modifications:

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
add(CharSequence
the name of the header.
name
,
CharSequence
the value of the header.
value
)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds a new header with the specified name and value.
public Http2Headers
add(CharSequence
the name of the header.
name
,
Iterable<? extends CharSequence>
the values of the header.
values
)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds new headers with the specified name and values.
public default Http2Headers
add(CharSequence
the name of the header.
name
,
Iterator<? extends CharSequence>
the values of the header.
valuesItr
)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds new headers with the specified name and values.
public Http2Headers
add(CharSequence
the name of the header.
name
,
CharSequence...
the values of the header.
values
)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds new headers with the specified name and values.
public Http2Headers
add(HttpHeaders
the headers to add.
headers
)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds all header names and values of headers to this object.
public Http2Headers
public default Http2Headers
addCookie(final CharSequence
the name of the cookie.
name
,
final CharSequence
the value of the cookie.
value
)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.addCookie.

Adds a cookie with the specified name and value.
public Http2Headers
public default Http2Headers
addSetCookie(final CharSequence
the name of the cookie.
name
,
final CharSequence
the value of the cookie.
value
)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.addSetCookie.

Adds a set-cookie with the specified name and value.
public Http2Headers
public CharSequence
authority()

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

public Http2Headers
public Http2Headers
copy()

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.copy.

Create an independent copy of these HTTP headers.
public static Http2Headers

Returns:

A new headers instance that use up as few resources as possible.
emptyHeaders
()

Hides io.netty5.handler.codec.http.headers.HttpHeaders.emptyHeaders.

Create a headers instance that is expected to remain empty.
public Http2Headers
public CharSequence
method()

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

public static Http2Headers

Returns:

A new empty header instance.
newHeaders
()

Hides io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

Create a header instance with default size hint, and all validation checks turned on.
public static Http2Headers

Returns:

A new empty headers instance.
newHeaders
(boolean
true to validate header names, values, and cookies.
validate
)

Hides io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

Create a headers instance with default size hint, and all validation checks turned on.
public static Http2Headers

Returns:

A new empty header instance with the given configuration.
newHeaders
(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.
sizeHint
,
boolean
true to validate header names.
checkNames
,
boolean
true to validate cookie contents when parsing.
checkCookies
,
boolean
true to validate header values.
checkValues
)

Hides io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

Create a header instance with the given size hint, and the given validation checks turned on.
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 default Http2Headers
replace(final HttpHeaders
the headers used to remove names and then add new entries.
headers
)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.replace.

Removes all header names contained in headers from this object, and then adds all headers contained in headers.
public Http2Headers
public CharSequence
scheme()

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

public Http2Headers
set(CharSequence
the name of the header.
name
,
CharSequence
the value of the header.
value
)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.set.

Sets a header with the specified name and value.
public Http2Headers
set(CharSequence
the name of the header.
name
,
Iterable<? extends CharSequence>
the values of the header.
values
)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.set.

Sets a new header with the specified name and values.
public default Http2Headers
set(CharSequence
the name of the header.
name
,
Iterator<? extends CharSequence>
the values of the header.
valueItr
)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.set.

Sets a new header with the specified name and values.
public default Http2Headers
set(CharSequence
the name of the header.
name
,
CharSequence...
the values of the header.
values
)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.set.

Sets a header with the specified name and values.
public default Http2Headers
set(final HttpHeaders
the headers object which contains new values.
headers
)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.set.

Clears the current header entries and copies all header entries of the specified headers object.
public Http2Headers
public CharSequence
status()

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

Inherited from io.netty5.handler.codec.http.headers.HttpHeaders:
containscontainscontainsIgnoreCasegetgetgetAndRemovegetAndRemovegetCookiegetCookiesgetCookiesgetCookiesIteratorgetCookiesIteratorgetSetCookiegetSetCookiesgetSetCookiesgetSetCookiesgetSetCookiesIteratorgetSetCookiesIteratorgetSetCookiesIteratorisEmptyiteratornamesremoveremoveremoveCookiesremoveIgnoreCaseremoveSetCookiesremoveSetCookiessizespliteratortoStringtoStringvaluesvaluesIterator

Method Detail

addback to summary
public Http2Headers add(CharSequence name, CharSequence value)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.add.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds a new header with the specified name and value.

Parameters
name:CharSequence

the name of the header.

value:CharSequence

the value of the header.

Returns:Http2Headers

this.

Annotations
@Override
addback to summary
public Http2Headers add(CharSequence name, Iterable<? extends CharSequence> values)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.add.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds new headers with the specified name and values. This method is semantically equivalent to:

for (T value : values) {
    headers.add(name, value);
}
Parameters
name:CharSequence

the name of the header.

values:Iterable<? extends CharSequence>

the values of the header.

Returns:Http2Headers

this.

Annotations
@Override
addback to summary
public default Http2Headers add(CharSequence name, Iterator<? extends CharSequence> valuesItr)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.add.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds new headers with the specified name and values. This method is semantically equivalent to:

while (valueItr.hasNext()) {
    headers.add(name, valueItr.next());
}
Parameters
name:CharSequence

the name of the header.

valuesItr:Iterator<? extends CharSequence>

the values of the header.

Returns:Http2Headers

this.

Annotations
@Override
addback to summary
public Http2Headers add(CharSequence name, CharSequence... values)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.add.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds new headers with the specified name and values. This method is semantically equivalent to:

for (T value : values) {
    headers.add(name, value);
}
Parameters
name:CharSequence

the name of the header.

values:CharSequence[]

the values of the header.

Returns:Http2Headers

this.

Annotations
@Override
addback to summary
public Http2Headers add(HttpHeaders headers)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.add.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds all header names and values of headers to this object.

Parameters
headers:HttpHeaders

the headers to add.

Returns:Http2Headers

this.

Annotations
@Override
addCookieback to summary
public Http2Headers addCookie(HttpCookiePair cookie)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.addCookie.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.addCookie.

Adds a cookie.

This may result in multiple HttpCookiePairs with same name.

Parameters
cookie:HttpCookiePair

the cookie to add.

Returns:Http2Headers

this.

Annotations
@Override
addCookieback to summary
public default Http2Headers addCookie(final CharSequence name, final CharSequence value)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.addCookie.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.addCookie.

Adds a cookie with the specified name and value.

This may result in multiple HttpSetCookies with same name. Added cookie will not be wrapped, not secure, and not HTTP-only, with no path, domain, expire date and maximum age.

Parameters
name:CharSequence

the name of the cookie.

value:CharSequence

the value of the cookie.

Returns:Http2Headers

this.

Annotations
@Override
addSetCookieback to summary
public Http2Headers addSetCookie(HttpSetCookie cookie)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.addSetCookie.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.addSetCookie.

Adds a set-cookie.

This may result in multiple HttpSetCookies with same name.

Parameters
cookie:HttpSetCookie

the cookie to add.

Returns:Http2Headers

this.

Annotations
@Override
addSetCookieback to summary
public default Http2Headers addSetCookie(final CharSequence name, final CharSequence value)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.addSetCookie.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.addSetCookie.

Adds a set-cookie with the specified name and value.

This may result in multiple HttpSetCookies with same name. Added cookie will not be wrapped, not secure, and not HTTP-only, with no path, domain, expire date and maximum age.

Parameters
name:CharSequence

the name of the cookie.

value:CharSequence

the value of the cookie.

Returns:Http2Headers

this.

Annotations
@Override
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

clearback to summary
public Http2Headers clear()

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.clear.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.clear.

Removes all headers.

Returns:Http2Headers

this.

Annotations
@Override
copyback to summary
public Http2Headers copy()

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.copy.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.copy.

Create an independent copy of these HTTP headers.

Returns:Http2Headers

A new headers instance, with the same contents as this one.

Annotations
@Override
emptyHeadersback to summary
public static Http2Headers emptyHeaders()

Hides io.netty5.handler.codec.http.headers.HttpHeaders.emptyHeaders.

Create a headers instance that is expected to remain empty.

Returns:Http2Headers

A new headers instance that use up as few resources as possible.

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

newHeadersback to summary
public static Http2Headers newHeaders()

Hides io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

Create a header instance with default size hint, and all validation checks turned on.

Returns:Http2Headers

A new empty header instance.

newHeadersback to summary
public static Http2Headers newHeaders(boolean validate)

Hides io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

Create a headers instance with default size hint, and all validation checks turned on.

Parameters
validate:boolean

true to validate header names, values, and cookies.

Returns:Http2Headers

A new empty headers instance.

newHeadersback to summary
public static Http2Headers newHeaders(int sizeHint, boolean checkNames, boolean checkCookies, boolean checkValues)

Hides io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

Create a header instance with the given size hint, and the given validation checks turned on.

Parameters
sizeHint:int

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

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.

checkNames:boolean

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

true to validate header names.

checkCookies:boolean

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

true to validate cookie contents when parsing.

checkValues:boolean

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.newHeaders.

true to validate header values.

Returns:Http2Headers

A new empty header instance with the given configuration.

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

replaceback to summary
public default Http2Headers replace(final HttpHeaders headers)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.replace.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.replace.

Removes all header names contained in headers from this object, and then adds all headers contained in headers.

Parameters
headers:HttpHeaders

the headers used to remove names and then add new entries.

Returns:Http2Headers

this.

Annotations
@Override
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

setback to summary
public Http2Headers set(CharSequence name, CharSequence value)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.set.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.set.

Sets a header with the specified name and value. Any existing headers with the same name are overwritten.

Parameters
name:CharSequence

the name of the header.

value:CharSequence

the value of the header.

Returns:Http2Headers

this.

Annotations
@Override
setback to summary
public Http2Headers set(CharSequence name, Iterable<? extends CharSequence> values)

Redeclares io.netty5.handler.codec.http.headers.HttpHeaders.set.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.set.

Sets a new header with the specified name and values. This method is equivalent to:

headers.remove(name);
for (T value : values) {
    headers.add(name, value);
}
Parameters
name:CharSequence

the name of the header.

values:Iterable<? extends CharSequence>

the values of the header.

Returns:Http2Headers

this.

Annotations
@Override
setback to summary
public default Http2Headers set(CharSequence name, Iterator<? extends CharSequence> valueItr)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.set.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.set.

Sets a new header with the specified name and values. This method is equivalent to:

headers.remove(name);
while (valueItr.hasNext()) {
    headers.add(name, valueItr.next());
}
Parameters
name:CharSequence

the name of the header.

valueItr:Iterator<? extends CharSequence>

the values of the header.

Returns:Http2Headers

this.

Annotations
@Override
setback to summary
public default Http2Headers set(CharSequence name, CharSequence... values)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.set.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.set.

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 value : values) {
    headers.add(name, value);
}
Parameters
name:CharSequence

the name of the header.

values:CharSequence[]

the values of the header.

Returns:Http2Headers

this.

Annotations
@Override
setback to summary
public default Http2Headers set(final HttpHeaders headers)

Overrides default io.netty5.handler.codec.http.headers.HttpHeaders.set.

Doc from io.netty5.handler.codec.http.headers.HttpHeaders.set.

Clears the current header entries and copies all header entries of the specified headers object.

Parameters
headers:HttpHeaders

the headers object which contains new values.

Returns:Http2Headers

this.

Annotations
@Override
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

io.netty5.handler.codec.http2.headers 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 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 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.

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.

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