Top Description Inners Fields Constructors Methods
io.netty5.handler.codec.http.headers

public Class DefaultHttpHeaders

extends MultiMap<CharSequence, CharSequence>
implements HttpHeaders
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.http.headers.HttpHeaders, java.lang.Iterable
Known Direct Subclasses
io.netty5.handler.codec.http.DefaultLastHttpContent.TrailingHttpHeaders
Imports
io.netty5.handler.codec.http.headers.HeaderUtils.AbstractCookiesByNameIterator, .HeaderUtils.AbstractCookiesIterator, io.netty5.util.AsciiString, org.jetbrains.annotations.NotNull, .Nullable, java.util.ArrayList, .Iterator, .List, .Map, .NoSuchElementException, .Set, java.util.function.BiPredicate

Default implementation of HttpHeaders.

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private class
private class
private class

Field Summary

Modifier and TypeField and Description
protected final boolean
protected final boolean
protected final boolean
Inherited from io.netty5.handler.codec.http.headers.MultiMap:
entrieslastBucketHead

Constructor Summary

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

Create a new instance.

Method Summary

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

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

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

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

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

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

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

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

Adds all header names and values of headers to this object.
public HttpHeaders
public HttpHeaders
public HttpHeaders
public boolean
contains(CharSequence
the header name.
key
,
CharSequence
the header value of the header to find.
value
)

Overrides io.netty5.handler.codec.http.headers.MultiMap.contains.

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

Returns true if a header with the name and value exists, false otherwise.
private static boolean
private static boolean
private static boolean
public boolean
containsIgnoreCase(final CharSequence
the name of the header to find.
name
,
final CharSequence
the value of the header to find.
value
)

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

Returns true if a header with the name and value exists, false otherwise.
public HttpHeaders
copy()

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

Create an independent copy of these HTTP headers.
protected boolean
equals(final CharSequence
The first key.
name1
,
final CharSequence
The second key.
name2
)

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

Compare key1 and key2 for equality.
protected boolean
equalsForValue(final CharSequence
The first value.
value1
,
final CharSequence
The second value.
value2
)

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

Compare value1 and value2 for equality.
private static @Nullable MultiMap.MultiMapEntry<CharSequence, CharSequence>
public @Nullable CharSequence
get(final CharSequence
the name of the header to retrieve.
name
)

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

Returns the value of a header with the specified name.
public @Nullable CharSequence
getAndRemove(final CharSequence
the name of the header to retrieve.
name
)

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

Returns the value of a header with the specified name and removes it from this object.
public @Nullable HttpCookiePair
getCookie(final CharSequence
the cookie-name to look for.
name
)

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

Gets a cookie identified by name.
public Iterator<HttpCookiePair>
public Iterator<HttpCookiePair>
getCookiesIterator(final CharSequence
the cookie-name of the HttpSetCookies to get.
name
)

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

Gets the cookies with the same name.
public @Nullable HttpSetCookie
getSetCookie(final CharSequence
the cookie-name to look for.
name
)

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

Gets a set-cookie identified by name.
public Iterator<HttpSetCookie>
public Iterator<HttpSetCookie>
getSetCookiesIterator(final CharSequence
the cookie-name of the HttpSetCookies to get.
name
)

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

Gets the set-cookies with the same name.
public Iterator<HttpSetCookie>
getSetCookiesIterator(final CharSequence
the cookie-name of the HttpSetCookies to get.
name
,
final CharSequence
the domain-value of the HttpSetCookies to get. This value may be matched according to the Domain Matching algorithm.
domain
,
final CharSequence
the path-av of the HttpSetCookies to get. This value may be matched according to the Path Matching algorithm.
path
)

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

Gets the set-cookies with the same name.
protected int
hashCode(final CharSequence
The key to create the hash code for.
name
)

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

Generate a hash code for key used as an index in this MultiMap.
protected int
hashCodeForValue(final CharSequence
the value to generate a hash code for.
value
)

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

Generate a hash code for value using for equality comparisons and hashCode(Object).
protected boolean
isKeyEqualityCompatible(final MultiMap<? extends CharSequence, ? extends CharSequence>
the MultiMap to compare.
multiMap
)

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

Determine if the hashCode(Object) and equals(Object, Object) strategy are compatible with multiMap.
public Iterator<Map.Entry<CharSequence, CharSequence>>
iterator()

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

Returns an iterator over elements of type T.
public Set<CharSequence>
names()

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

Returns a Set of all header names in this object.
public boolean
remove(final CharSequence
the name of the header.
name
)

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

Removes all headers with the specified name.
public boolean
remove(final CharSequence
the name of the header.
name
,
final CharSequence
the value of the header to remove.
value
)

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

Removes specific value(s) from the specified header name.
private boolean
remove(final CharSequence name, final CharSequence value, final boolean caseSensitive)

public boolean
removeCookies(final CharSequence
the cookie-name of the HttpSetCookies to remove.
name
)

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

Removes all cookie identified by name.
public boolean
removeIgnoreCase(final CharSequence
the name of the header.
name
,
final CharSequence
the value of the header to remove.
value
)

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

Removes specific value(s) from the specified header name.
public boolean
removeSetCookies(final CharSequence
the cookie-name of the HttpSetCookies to remove.
name
)

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

Removes all set-cookie identified by name.
public boolean
removeSetCookies(final CharSequence
the cookie-name of the HttpSetCookies to remove.
name
,
final CharSequence
the domain-value of the HttpSetCookies to remove. This value may be matched according to the Domain Matching algorithm.
domain
,
final CharSequence
the path-av of the HttpSetCookies to remove. This value may be matched according to the Path Matching algorithm.
path
)

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

Removes all set-cookie identified by name.
public HttpHeaders
set(final CharSequence
the name of the header.
name
,
final CharSequence
the value of the header.
value
)

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

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

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

Sets a new header with the specified name and values.
public HttpHeaders
set(final CharSequence
the name of the header.
name
,
final 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 String
protected static void
validateHeaderName(final CharSequence
The filed-name to validate.
name
)

Validate a field-name of a header-field.

private static void
validateHeaderValue(final CharSequence
The field-value to validate.
value
)

Validate a field-value of a header-field.

protected CharSequence
validateKey(final @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
,
final CharSequence
The value which will be inserted.
value
)

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

Validate the value before inserting it into this MultiMap.
public Iterator<CharSequence>
valuesIterator(final CharSequence
the name of the header to retrieve.
name
)

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

Returns all values for the header with the specified name.
Inherited from io.netty5.handler.codec.http.headers.MultiMap:
clearAllcontainsentryIteratorequalsgetKeysgetValuegetValueshashCodeindexisEmptyputputAllputAllputAllputExclusiveputExclusiveputExclusiveremoveAllremoveAllAndGetFirstremoveEntrysizevalueIterator