Module io.inverno.mod.http.base
Class LinkedHttpHeaders
java.lang.Object
io.netty.handler.codec.http.HttpHeaders
io.inverno.mod.http.base.internal.netty.LinkedHttpHeaders
public class LinkedHttpHeaders
extends io.netty.handler.codec.http.HttpHeaders
Optimized HttpHeaders implementation.
This implementation is based on a linked list keeping a pointer to the head and the tail of the list for fast access.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested classes/interfaces inherited from class io.netty.handler.codec.http.HttpHeaders
io.netty.handler.codec.http.HttpHeaders.Names, io.netty.handler.codec.http.HttpHeaders.Values -
Field Summary
Fields inherited from class io.netty.handler.codec.http.HttpHeaders
EMPTY_HEADERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.netty.handler.codec.http.HttpHeadersadd(CharSequence name, Iterable<?> values) io.netty.handler.codec.http.HttpHeadersadd(CharSequence name, Object value) io.netty.handler.codec.http.HttpHeadersio.netty.handler.codec.http.HttpHeadersio.netty.handler.codec.http.HttpHeadersaddCharSequence(CharSequence name, CharSequence value) Adds the specified header.io.netty.handler.codec.http.HttpHeadersaddCharSequence(CharSequence name, Iterable<CharSequence> values) Adds the specified header with multiple values.io.netty.handler.codec.http.HttpHeadersaddInt(CharSequence name, int value) io.netty.handler.codec.http.HttpHeadersaddLong(CharSequence name, long value) Adds the specified header.io.netty.handler.codec.http.HttpHeadersaddShort(CharSequence name, short value) io.netty.handler.codec.http.HttpHeadersclear()booleancontains(CharSequence name) booleancontains(CharSequence name, CharSequence value, boolean ignoreCase) booleanbooleanvoidencode(io.netty.buffer.ByteBuf buf) Encodes the headers into the specified buffer.entries()Returns headers as entries of char sequences.get(CharSequence name) getAll(CharSequence name) Returns all header values as char sequences.getCharSequence(CharSequence name) Returns a header value as char sequence.getInt(CharSequence name) intgetInt(CharSequence name, int defaultValue) getLong(CharSequence name) Returns a header value as long.longgetLong(CharSequence name, long defaultValue) Returns a header value as long defaulting the the specified default value.getShort(CharSequence name) shortgetShort(CharSequence name, short defaultValue) getTimeMillis(CharSequence name) longgetTimeMillis(CharSequence name, long defaultValue) booleanisEmpty()iterator()Deprecated.names()io.netty.handler.codec.http.HttpHeadersremove(CharSequence name) io.netty.handler.codec.http.HttpHeadersio.netty.handler.codec.http.HttpHeadersset(CharSequence name, Iterable<?> values) io.netty.handler.codec.http.HttpHeadersset(CharSequence name, Object value) io.netty.handler.codec.http.HttpHeadersio.netty.handler.codec.http.HttpHeaderssetCharSequence(CharSequence name, CharSequence value) Sets the value of the specified header.io.netty.handler.codec.http.HttpHeaderssetCharSequence(CharSequence name, Iterable<CharSequence> values) Sets multiple values for the specified header.io.netty.handler.codec.http.HttpHeaderssetInt(CharSequence name, int value) io.netty.handler.codec.http.HttpHeaderssetLong(CharSequence name, long value) Sets the value of the specified header.io.netty.handler.codec.http.HttpHeaderssetShort(CharSequence name, short value) intsize()Methods inherited from class io.netty.handler.codec.http.HttpHeaders
add, addDateHeader, addDateHeader, addHeader, addHeader, addIntHeader, addIntHeader, clearHeaders, containsValue, copy, encodeAscii, equalsIgnoreCase, get, getAllAsString, getAsString, getContentLength, getContentLength, getDate, getDate, getDateHeader, getDateHeader, getDateHeader, getDateHeader, getHeader, getHeader, getHeader, getHeader, getHost, getHost, getIntHeader, getIntHeader, getIntHeader, getIntHeader, is100ContinueExpected, isContentLengthSet, isKeepAlive, isTransferEncodingChunked, iteratorAsString, newEntity, removeHeader, removeHeader, removeTransferEncodingChunked, set, set100ContinueExpected, set100ContinueExpected, setAll, setContentLength, setDate, setDateHeader, setDateHeader, setDateHeader, setDateHeader, setHeader, setHeader, setHeader, setHeader, setHost, setHost, setIntHeader, setIntHeader, setIntHeader, setIntHeader, setKeepAlive, setTransferEncodingChunked, toString, valueCharSequenceIterator, valueStringIteratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
LinkedHttpHeaders
public LinkedHttpHeaders()Creates linked HTTP headers.
-
-
Method Details
-
get
- Specified by:
getin classio.netty.handler.codec.http.HttpHeaders
-
get
- Overrides:
getin classio.netty.handler.codec.http.HttpHeaders
-
getAll
- Specified by:
getAllin classio.netty.handler.codec.http.HttpHeaders
-
getAll
- Overrides:
getAllin classio.netty.handler.codec.http.HttpHeaders
-
getAllCharSequence
Returns all header values as char sequences.
- Parameters:
name- the name of the header- Returns:
- a list of values or an empty list
-
getCharSequence
Returns a header value as char sequence.
- Parameters:
name- the name of the header- Returns:
- the value or null
-
getInt
- Specified by:
getIntin classio.netty.handler.codec.http.HttpHeaders
-
getInt
- Specified by:
getIntin classio.netty.handler.codec.http.HttpHeaders
-
getLong
Returns a header value as long.
- Parameters:
name- the name of the header- Returns:
- the value or null
-
getLong
Returns a header value as long defaulting the the specified default value.
- Parameters:
name- the name of the headerdefaultValue- the default value- Returns:
- the value or the default value
-
getShort
- Specified by:
getShortin classio.netty.handler.codec.http.HttpHeaders
-
getShort
- Specified by:
getShortin classio.netty.handler.codec.http.HttpHeaders
-
getTimeMillis
- Specified by:
getTimeMillisin classio.netty.handler.codec.http.HttpHeaders
-
getTimeMillis
- Specified by:
getTimeMillisin classio.netty.handler.codec.http.HttpHeaders
-
add
- Specified by:
addin classio.netty.handler.codec.http.HttpHeaders
-
add
- Overrides:
addin classio.netty.handler.codec.http.HttpHeaders
-
add
- Specified by:
addin classio.netty.handler.codec.http.HttpHeaders
-
add
- Overrides:
addin classio.netty.handler.codec.http.HttpHeaders
-
addCharSequence
public io.netty.handler.codec.http.HttpHeaders addCharSequence(CharSequence name, CharSequence value) Adds the specified header.
- Parameters:
name- the name of the headervalue- the value of the header- Returns:
- the HTTP headers
-
addCharSequence
public io.netty.handler.codec.http.HttpHeaders addCharSequence(CharSequence name, Iterable<CharSequence> values) Adds the specified header with multiple values.
- Parameters:
name- the name of the headervalues- an iterable providing the values- Returns:
-
addInt
- Specified by:
addIntin classio.netty.handler.codec.http.HttpHeaders
-
addLong
Adds the specified header.
- Parameters:
name- the name of the headervalue- the value of the header- Returns:
- the HTTP headers
-
addShort
- Specified by:
addShortin classio.netty.handler.codec.http.HttpHeaders
-
set
- Specified by:
setin classio.netty.handler.codec.http.HttpHeaders
-
set
- Overrides:
setin classio.netty.handler.codec.http.HttpHeaders
-
set
- Specified by:
setin classio.netty.handler.codec.http.HttpHeaders
-
set
- Overrides:
setin classio.netty.handler.codec.http.HttpHeaders
-
setCharSequence
Sets the value of the specified header.
- Parameters:
name- the name of the headervalue- the value to set- Returns:
- the HTTP headers
-
setCharSequence
public io.netty.handler.codec.http.HttpHeaders setCharSequence(CharSequence name, Iterable<CharSequence> values) Sets multiple values for the specified header.
- Parameters:
name- the name of the headervalues- an iterable providing the values- Returns:
- the HTTP headers
-
setInt
- Specified by:
setIntin classio.netty.handler.codec.http.HttpHeaders
-
setLong
Sets the value of the specified header.
- Parameters:
name- the name of the headervalue- the value to set- Returns:
- the HTTP headers
-
setShort
- Specified by:
setShortin classio.netty.handler.codec.http.HttpHeaders
-
remove
- Specified by:
removein classio.netty.handler.codec.http.HttpHeaders
-
remove
- Overrides:
removein classio.netty.handler.codec.http.HttpHeaders
-
clear
public io.netty.handler.codec.http.HttpHeaders clear()- Specified by:
clearin classio.netty.handler.codec.http.HttpHeaders
-
entries
- Specified by:
entriesin classio.netty.handler.codec.http.HttpHeaders
-
entriesCharSequence
Returns headers as entries of char sequences.
- Returns:
- the headers entries
-
names
- Specified by:
namesin classio.netty.handler.codec.http.HttpHeaders
-
contains
- Specified by:
containsin classio.netty.handler.codec.http.HttpHeaders
-
contains
- Overrides:
containsin classio.netty.handler.codec.http.HttpHeaders
-
contains
- Overrides:
containsin classio.netty.handler.codec.http.HttpHeaders
-
contains
- Overrides:
containsin classio.netty.handler.codec.http.HttpHeaders
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin classio.netty.handler.codec.http.HttpHeaders
-
size
public int size()- Specified by:
sizein classio.netty.handler.codec.http.HttpHeaders
-
iterator
Deprecated. -
iteratorCharSequence
- Specified by:
iteratorCharSequencein classio.netty.handler.codec.http.HttpHeaders
-
encode
public void encode(io.netty.buffer.ByteBuf buf) Encodes the headers into the specified buffer.
- Parameters:
buf- the traget buffer
-