Class EmptyHttpHeaders
java.lang.Object
io.netty.handler.codec.http.HttpHeaders
io.netty.handler.codec.http.EmptyHttpHeaders
-
Nested Class Summary
Nested classes/interfaces inherited from class HttpHeaders
HttpHeaders.Names, HttpHeaders.Values -
Field Summary
FieldsFields inherited from class HttpHeaders
EMPTY_HEADERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddInt(CharSequence name, int value) Add thenametovalue.addShort(CharSequence name, short value) Add thenametovalue.clear()Removes all headers from thisHttpMessage.booleanentries()Returns a newListthat contains all headers in this object.getInt(CharSequence name) Returns the integer value of a header with the specified name.intgetInt(CharSequence name, int defaultValue) Returns the integer value of a header with the specified name.getShort(CharSequence name) Returns the short value of a header with the specified name.shortgetShort(CharSequence name, short defaultValue) Returns the short value of a header with the specified name.getTimeMillis(CharSequence name) Returns the date value of a header with the specified name.longgetTimeMillis(CharSequence name, long defaultValue) Returns the date value of a header with the specified name.booleanisEmpty()Checks if no header exists.iterator()names()Returns a newSetthat contains the names of all headers in this object.setInt(CharSequence name, int value) Set thenametovalue.setShort(CharSequence name, short value) Set thenametovalue.intsize()Returns the number of headers in this object.Methods inherited from class HttpHeaders
add, add, add, addDateHeader, addDateHeader, addHeader, addHeader, addIntHeader, addIntHeader, clearHeaders, contains, contains, contains, containsValue, copy, encodeAscii, equalsIgnoreCase, get, get, getAll, 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, remove, removeHeader, removeHeader, removeTransferEncodingChunked, set, set, 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
EmptyHttpHeaders
protected EmptyHttpHeaders()
-
-
Method Details
-
get
- Specified by:
getin classHttpHeaders- See Also:
-
getInt
Description copied from class:HttpHeadersReturns the integer value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.- Specified by:
getIntin classHttpHeaders- Parameters:
name- the name of the header to search- Returns:
- the first header value if the header is found and its value is an integer.
nullif there's no such header or its value is not an integer.
-
getInt
Description copied from class:HttpHeadersReturns the integer value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.- Specified by:
getIntin classHttpHeaders- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the first header value if the header is found and its value is an integer.
defaultValueif there's no such header or its value is not an integer.
-
getShort
Description copied from class:HttpHeadersReturns the short value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.- Specified by:
getShortin classHttpHeaders- Parameters:
name- the name of the header to search- Returns:
- the first header value if the header is found and its value is a short.
nullif there's no such header or its value is not a short.
-
getShort
Description copied from class:HttpHeadersReturns the short value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.- Specified by:
getShortin classHttpHeaders- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the first header value if the header is found and its value is a short.
defaultValueif there's no such header or its value is not a short.
-
getTimeMillis
Description copied from class:HttpHeadersReturns the date value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.- Specified by:
getTimeMillisin classHttpHeaders- Parameters:
name- the name of the header to search- Returns:
- the first header value if the header is found and its value is a date.
nullif there's no such header or its value is not a date.
-
getTimeMillis
Description copied from class:HttpHeadersReturns the date value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.- Specified by:
getTimeMillisin classHttpHeaders- Parameters:
name- the name of the header to searchdefaultValue- the default value- Returns:
- the first header value if the header is found and its value is a date.
defaultValueif there's no such header or its value is not a date.
-
getAll
- Specified by:
getAllin classHttpHeaders- See Also:
-
entries
Description copied from class:HttpHeadersReturns a newListthat contains all headers in this object. Note that modifying the returnedListwill not affect the state of this object. If you intend to enumerate over the header entries only, useHttpHeaders.iterator()instead, which has much less overhead.- Specified by:
entriesin classHttpHeaders- See Also:
-
contains
- Specified by:
containsin classHttpHeaders- See Also:
-
isEmpty
public boolean isEmpty()Description copied from class:HttpHeadersChecks if no header exists.- Specified by:
isEmptyin classHttpHeaders
-
size
public int size()Description copied from class:HttpHeadersReturns the number of headers in this object.- Specified by:
sizein classHttpHeaders
-
names
Description copied from class:HttpHeadersReturns a newSetthat contains the names of all headers in this object. Note that modifying the returnedSetwill not affect the state of this object. If you intend to enumerate over the header entries only, useHttpHeaders.iterator()instead, which has much less overhead.- Specified by:
namesin classHttpHeaders
-
add
- Specified by:
addin classHttpHeaders- See Also:
-
add
- Specified by:
addin classHttpHeaders- See Also:
-
addInt
Description copied from class:HttpHeadersAdd thenametovalue.- Specified by:
addIntin classHttpHeaders- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
addShort
Description copied from class:HttpHeadersAdd thenametovalue.- Specified by:
addShortin classHttpHeaders- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
set
- Specified by:
setin classHttpHeaders- See Also:
-
set
- Specified by:
setin classHttpHeaders- See Also:
-
setInt
Description copied from class:HttpHeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setIntin classHttpHeaders- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
setShort
Description copied from class:HttpHeadersSet thenametovalue. This will remove all previous values associated withname.- Specified by:
setShortin classHttpHeaders- Parameters:
name- The name to modifyvalue- The value- Returns:
this
-
remove
- Specified by:
removein classHttpHeaders- See Also:
-
clear
Description copied from class:HttpHeadersRemoves all headers from thisHttpMessage.- Specified by:
clearin classHttpHeaders- Returns:
this
-
iterator
-
iteratorCharSequence
- Specified by:
iteratorCharSequencein classHttpHeaders- Returns:
- Iterator over the name/value header pairs.
-