Top Description Fields Constructors Methods
io.netty5.handler.codec.http2.headers

public Class DefaultHttp2Headers

extends DefaultHttpHeaders
implements Http2Headers
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.http2.headers.Http2Headers, io.netty5.handler.codec.http.headers.HttpHeaders, java.lang.Iterable
Imports
io.netty5.handler.codec.http.headers.DefaultHttpHeaders, .HeaderValidationException, .HttpCookiePair, .HttpHeaderValidationUtil, .HttpHeaders, .HttpSetCookie, .MultiMap, io.netty5.util.AsciiString, .ByteProcessor, org.jetbrains.annotations.Nullable, java.util.Iterator, .Map.Entry, .NoSuchElementException, java.util.function.Predicate, .Supplier

Default implementation of Http2Headers.

API Note

It is an implementation detail that this class extends MultiMap. The multi-map itself is not part of the public API for this class. Only the methods declared in HttpHeaders are considered public API.

Field Summary

Modifier and TypeField and Description
private static final ByteProcessor
Inherited from io.netty5.handler.codec.http.headers.DefaultHttpHeaders:
validateCookiesvalidateNamesvalidateValues

Constructor Summary

AccessConstructor and Description
public
DefaultHttp2Headers(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
,
boolean
true to validate header names.
validateNames
,
boolean
true to validate cookie contents when parsing.
validateCookies
,
boolean
true to validate header values.
validateValues
)

Create a new instance.

Method Summary

Modifier and TypeMethod and Description
public Http2Headers
add(CharSequence
the name of the header.
name
,
CharSequence
the value of the header.
value
)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.add.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.add, 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
)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.add.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.add, 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
,
Iterator<? extends CharSequence>
the values of the header.
valuesItr
)

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.add, 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
)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.add.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.add, io.netty5.handler.codec.http.headers.HttpHeaders.add.

Adds new headers with the specified name and values.
public Http2Headers
public Http2Headers
public Http2Headers
addCookie(final CharSequence
the name of the cookie.
name
,
final CharSequence
the value of the cookie.
value
)

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.addCookie, io.netty5.handler.codec.http.headers.HttpHeaders.addCookie.

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

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.addSetCookie, io.netty5.handler.codec.http.headers.HttpHeaders.addSetCookie.

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

Implements io.netty5.handler.codec.http2.headers.Http2Headers.authority.

Gets the PseudoHeaderName#AUTHORITY header or null if there is no such header
public Http2Headers
private static <T> Iterator<T>
concat(Iterator<T> first, Supplier<Iterator<T>> secondSupplier)

public Http2Headers
private static <T> Iterator<T>
filter(Iterator<T> iterator, Predicate<T> predicate)

public Iterator<Map.Entry<CharSequence, CharSequence>>
public Http2Headers
public CharSequence
method()

Implements io.netty5.handler.codec.http2.headers.Http2Headers.method.

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

Implements io.netty5.handler.codec.http2.headers.Http2Headers.path.

Gets the PseudoHeaderName#PATH header or null if there is no such header
public Http2Headers
replace(final HttpHeaders
the headers used to remove names and then add new entries.
headers
)

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.replace, 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()

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

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.set.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.set, 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
)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.set.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.set, io.netty5.handler.codec.http.headers.HttpHeaders.set.

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

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.set, io.netty5.handler.codec.http.headers.HttpHeaders.set.

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

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.set.

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.set, io.netty5.handler.codec.http.headers.HttpHeaders.set.

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

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.set, 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()

Implements io.netty5.handler.codec.http2.headers.Http2Headers.status.

Gets the PseudoHeaderName#STATUS header or null if there is no such header
protected CharSequence
validateKey(@Nullable CharSequence
The key which will be inserted.
name
,
boolean
true if this validation is for adding to the headers, or false if this is for setting (overwriting) the given header.
forAdd
)

Implements abstract io.netty5.handler.codec.http.headers.MultiMap.validateKey.

Validate the key before inserting it into this MultiMap.
protected CharSequence
validateValue(CharSequence
The key for which the value is being inserted, for reference.
key
,
CharSequence
The value which will be inserted.
value
)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.validateValue.

Validate the value before inserting it into this MultiMap.
Inherited from io.netty5.handler.codec.http.headers.DefaultHttpHeaders:
containscontainsIgnoreCaseequalsequalsForValuegetgetAndRemovegetCookiegetCookiesIteratorgetCookiesIteratorgetSetCookiegetSetCookiesIteratorgetSetCookiesIteratorgetSetCookiesIteratorhashCodehashCodeForValueisKeyEqualityCompatiblenamesremoveremoveremoveCookiesremoveIgnoreCaseremoveSetCookiesremoveSetCookiestoStringvalidateHeaderNamevalidateKeyvaluesIterator

Field Detail

HTTP2_NAME_VALIDATOR_PROCESSORback to summary
private static final ByteProcessor HTTP2_NAME_VALIDATOR_PROCESSOR

Constructor Detail

DefaultHttp2Headersback to summary
public DefaultHttp2Headers(int arraySizeHint, boolean validateNames, boolean validateCookies, boolean validateValues)

Create a new instance.

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

validateNames:boolean

true to validate header names.

validateCookies:boolean

true to validate cookie contents when parsing.

validateValues:boolean

true to validate header values.

Method Detail

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

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.add.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.add, 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)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.add.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.add, 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 Http2Headers add(CharSequence name, Iterator<? extends CharSequence> valuesItr)

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.add, 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)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.add.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.add, 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)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.add.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.add, 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)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.addCookie.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.addCookie, 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 Http2Headers addCookie(final CharSequence name, final CharSequence value)

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.addCookie, 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)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.addSetCookie.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.addSetCookie, 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 Http2Headers addSetCookie(final CharSequence name, final CharSequence value)

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.addSetCookie, 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)

Implements io.netty5.handler.codec.http2.headers.Http2Headers.authority.

Doc from io.netty5.handler.codec.http2.headers.Http2Headers.authority.

Sets the PseudoHeaderName#AUTHORITY header

Annotations
@Override
authorityback to summary
public CharSequence authority()

Implements io.netty5.handler.codec.http2.headers.Http2Headers.authority.

Doc from io.netty5.handler.codec.http2.headers.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.netty5.handler.codec.http.headers.DefaultHttpHeaders.clear.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.clear, 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
concatback to summary
private static <T> Iterator<T> concat(Iterator<T> first, Supplier<Iterator<T>> secondSupplier)
copyback to summary
public Http2Headers copy()

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.copy.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.copy, 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
filterback to summary
private static <T> Iterator<T> filter(Iterator<T> iterator, Predicate<T> predicate)
iteratorback to summary
public Iterator<Map.Entry<CharSequence, CharSequence>> iterator()

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.iterator.

Implements io.netty5.handler.codec.http.headers.HttpHeaders.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

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

an Iterator.

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

Implements io.netty5.handler.codec.http2.headers.Http2Headers.method.

Doc from io.netty5.handler.codec.http2.headers.Http2Headers.method.

Sets the PseudoHeaderName#METHOD header

Annotations
@Override
methodback to summary
public CharSequence method()

Implements io.netty5.handler.codec.http2.headers.Http2Headers.method.

Doc from io.netty5.handler.codec.http2.headers.Http2Headers.method.

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

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

Implements io.netty5.handler.codec.http2.headers.Http2Headers.path.

Doc from io.netty5.handler.codec.http2.headers.Http2Headers.path.

Sets the PseudoHeaderName#PATH header

Annotations
@Override
pathback to summary
public CharSequence path()

Implements io.netty5.handler.codec.http2.headers.Http2Headers.path.

Doc from io.netty5.handler.codec.http2.headers.Http2Headers.path.

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

Annotations
@Override
replaceback to summary
public Http2Headers replace(final HttpHeaders headers)

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.replace, 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)

Implements io.netty5.handler.codec.http2.headers.Http2Headers.scheme.

Doc from io.netty5.handler.codec.http2.headers.Http2Headers.scheme.

Sets the PseudoHeaderName#SCHEME header

Annotations
@Override
schemeback to summary
public CharSequence scheme()

Implements io.netty5.handler.codec.http2.headers.Http2Headers.scheme.

Doc from io.netty5.handler.codec.http2.headers.Http2Headers.scheme.

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

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

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.set.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.set, 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)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.set.

Implements io.netty5.handler.codec.http2.headers.Http2Headers.set, 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 Http2Headers set(CharSequence name, Iterator<? extends CharSequence> valueItr)

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.set, 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 Http2Headers set(CharSequence name, CharSequence... values)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.set.

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.set, 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 Http2Headers set(final HttpHeaders headers)

Overrides default io.netty5.handler.codec.http2.headers.Http2Headers.set, 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)

Implements io.netty5.handler.codec.http2.headers.Http2Headers.status.

Doc from io.netty5.handler.codec.http2.headers.Http2Headers.status.

Sets the PseudoHeaderName#STATUS header

Annotations
@Override
statusback to summary
public CharSequence status()

Implements io.netty5.handler.codec.http2.headers.Http2Headers.status.

Doc from io.netty5.handler.codec.http2.headers.Http2Headers.status.

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

Annotations
@Override
validateKeyback to summary
protected CharSequence validateKey(@Nullable CharSequence name, boolean forAdd)

Implements abstract io.netty5.handler.codec.http.headers.MultiMap.validateKey.

Doc from io.netty5.handler.codec.http.headers.MultiMap.validateKey.

Validate the key before inserting it into this MultiMap.

Parameters
name:@Nullable CharSequence

The key which will be inserted.

forAdd:boolean

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

Annotations
@Override
validateValueback to summary
protected CharSequence validateValue(CharSequence key, CharSequence value)

Overrides io.netty5.handler.codec.http.headers.DefaultHttpHeaders.validateValue.

Doc from io.netty5.handler.codec.http.headers.MultiMap.validateValue.

Validate the value before inserting it into this MultiMap.

Parameters
key:CharSequence

The key for which the value is being inserted, for reference.

value:CharSequence

The value which will be inserted.

Annotations
@Override