Package io.netty.handler.codec.http
Class EmptyHttpHeaders
java.lang.Object
io.netty.handler.codec.http.HttpHeaders
io.netty.handler.codec.http.EmptyHttpHeaders
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
Deprecated.Nested classes/interfaces inherited from class io.netty.handler.codec.http.HttpHeaders
HttpHeaders.Names, HttpHeaders.Values
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Iterator
<Map.Entry<CharSequence, CharSequence>> static final EmptyHttpHeaders
Fields inherited from class io.netty.handler.codec.http.HttpHeaders
EMPTY_HEADERS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddInt
(CharSequence name, int value) Add thename
tovalue
.addShort
(CharSequence name, short value) Add thename
tovalue
.clear()
Removes all headers from thisHttpMessage
.boolean
entries()
Returns a newList
that contains all headers in this object.getInt
(CharSequence name) Returns the integer value of a header with the specified name.int
getInt
(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.short
getShort
(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.long
getTimeMillis
(CharSequence name, long defaultValue) Returns the date value of a header with the specified name.(package private) static EmptyHttpHeaders
instance()
Deprecated.boolean
isEmpty()
Checks if no header exists.iterator()
names()
Returns a newSet
that contains the names of all headers in this object.setInt
(CharSequence name, int value) Set thename
tovalue
.setShort
(CharSequence name, short value) Set thename
tovalue
.int
size()
Returns the number of headers in this object.Methods inherited from class io.netty.handler.codec.http.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, valueStringIterator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY_CHARS_ITERATOR
-
INSTANCE
-
-
Constructor Details
-
EmptyHttpHeaders
protected EmptyHttpHeaders()
-
-
Method Details
-
instance
Deprecated.UseINSTANCE
This is needed to break a cyclic static initialization loop between
HttpHeaders
andEmptyHttpHeaders
.- See Also:
-
get
- Specified by:
get
in classHttpHeaders
- See Also:
-
getInt
Description copied from class:HttpHeaders
Returns 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:
getInt
in 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.
null
if there's no such header or its value is not an integer.
-
getInt
Description copied from class:HttpHeaders
Returns 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:
getInt
in 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.
defaultValue
if there's no such header or its value is not an integer.
-
getShort
Description copied from class:HttpHeaders
Returns 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:
getShort
in 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.
null
if there's no such header or its value is not a short.
-
getShort
Description copied from class:HttpHeaders
Returns 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:
getShort
in 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.
defaultValue
if there's no such header or its value is not a short.
-
getTimeMillis
Description copied from class:HttpHeaders
Returns 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:
getTimeMillis
in 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.
null
if there's no such header or its value is not a date.
-
getTimeMillis
Description copied from class:HttpHeaders
Returns 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:
getTimeMillis
in 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.
defaultValue
if there's no such header or its value is not a date.
-
getAll
- Specified by:
getAll
in classHttpHeaders
- See Also:
-
entries
Description copied from class:HttpHeaders
Returns a newList
that contains all headers in this object. Note that modifying the returnedList
will 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:
entries
in classHttpHeaders
- See Also:
-
contains
- Specified by:
contains
in classHttpHeaders
- See Also:
-
isEmpty
public boolean isEmpty()Description copied from class:HttpHeaders
Checks if no header exists.- Specified by:
isEmpty
in classHttpHeaders
-
size
public int size()Description copied from class:HttpHeaders
Returns the number of headers in this object.- Specified by:
size
in classHttpHeaders
-
names
Description copied from class:HttpHeaders
Returns a newSet
that contains the names of all headers in this object. Note that modifying the returnedSet
will 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:
names
in classHttpHeaders
-
add
- Specified by:
add
in classHttpHeaders
- See Also:
-
add
- Specified by:
add
in classHttpHeaders
- See Also:
-
addInt
Description copied from class:HttpHeaders
Add thename
tovalue
.- Specified by:
addInt
in classHttpHeaders
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
addShort
Description copied from class:HttpHeaders
Add thename
tovalue
.- Specified by:
addShort
in classHttpHeaders
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
set
- Specified by:
set
in classHttpHeaders
- See Also:
-
set
- Specified by:
set
in classHttpHeaders
- See Also:
-
setInt
Description copied from class:HttpHeaders
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setInt
in classHttpHeaders
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
setShort
Description copied from class:HttpHeaders
Set thename
tovalue
. This will remove all previous values associated withname
.- Specified by:
setShort
in classHttpHeaders
- Parameters:
name
- The name to modifyvalue
- The value- Returns:
this
-
remove
- Specified by:
remove
in classHttpHeaders
- See Also:
-
clear
Description copied from class:HttpHeaders
Removes all headers from thisHttpMessage
.- Specified by:
clear
in classHttpHeaders
- Returns:
this
-
iterator
-
iteratorCharSequence
- Specified by:
iteratorCharSequence
in classHttpHeaders
- Returns:
- Iterator over the name/value header pairs.
-
INSTANCE