public class EmptyHttpHeaders extends HttpHeaders
HttpHeaders.Names, HttpHeaders.Values| Modifier and Type | Field and Description |
|---|---|
static EmptyHttpHeaders |
INSTANCE |
EMPTY_HEADERS| Modifier | Constructor and Description |
|---|---|
protected |
EmptyHttpHeaders() |
| Modifier and Type | Method and Description |
|---|---|
HttpHeaders |
add(String name,
Iterable<?> values) |
HttpHeaders |
add(String name,
Object value) |
HttpHeaders |
addInt(CharSequence name,
int value)
Add the
name to value. |
HttpHeaders |
addShort(CharSequence name,
short value)
Add the
name to value. |
HttpHeaders |
clear()
Removes all headers from this
HttpMessage. |
boolean |
contains(String name) |
List<Map.Entry<String,String>> |
entries()
Returns a new
List that contains all headers in this object. |
String |
get(String name) |
List<String> |
getAll(String name) |
Integer |
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.
|
Short |
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.
|
Long |
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.
|
boolean |
isEmpty()
Checks if no header exists.
|
Iterator<Map.Entry<String,String>> |
iterator() |
Iterator<Map.Entry<CharSequence,CharSequence>> |
iteratorCharSequence() |
Set<String> |
names()
Returns a new
Set that contains the names of all headers in this object. |
HttpHeaders |
remove(String name) |
HttpHeaders |
set(String name,
Iterable<?> values) |
HttpHeaders |
set(String name,
Object value) |
HttpHeaders |
setInt(CharSequence name,
int value)
Set the
name to value. |
HttpHeaders |
setShort(CharSequence name,
short value)
Set the
name to value. |
int |
size()
Returns the number of headers in this object.
|
add, add, add, addDateHeader, addDateHeader, addHeader, addHeader, addIntHeader, addIntHeader, clearHeaders, contains, contains, contains, containsValue, 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, setTransferEncodingChunkedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static final EmptyHttpHeaders INSTANCE
public String get(String name)
get in class HttpHeadersHttpHeaders.get(CharSequence)public Integer getInt(CharSequence name)
HttpHeadersgetInt in class HttpHeadersname - the name of the header to searchnull if there's no
such header or its value is not an integer.public int getInt(CharSequence name, int defaultValue)
HttpHeadersgetInt in class HttpHeadersname - the name of the header to searchdefaultValue - the default valuedefaultValue if
there's no such header or its value is not an integer.public Short getShort(CharSequence name)
HttpHeadersgetShort in class HttpHeadersname - the name of the header to searchnull if there's no
such header or its value is not a short.public short getShort(CharSequence name, short defaultValue)
HttpHeadersgetShort in class HttpHeadersname - the name of the header to searchdefaultValue - the default valuedefaultValue if
there's no such header or its value is not a short.public Long getTimeMillis(CharSequence name)
HttpHeadersgetTimeMillis in class HttpHeadersname - the name of the header to searchnull if there's no
such header or its value is not a date.public long getTimeMillis(CharSequence name, long defaultValue)
HttpHeadersgetTimeMillis in class HttpHeadersname - the name of the header to searchdefaultValue - the default valuedefaultValue if
there's no such header or its value is not a date.public List<String> getAll(String name)
getAll in class HttpHeadersHttpHeaders.getAll(CharSequence)public List<Map.Entry<String,String>> entries()
HttpHeadersList that contains all headers in this object. Note that modifying the
returned List will not affect the state of this object. If you intend to enumerate over the header
entries only, use HttpHeaders.iterator() instead, which has much less overhead.entries in class HttpHeadersHttpHeaders.iteratorCharSequence()public boolean contains(String name)
contains in class HttpHeadersHttpHeaders.contains(CharSequence)public boolean isEmpty()
HttpHeadersisEmpty in class HttpHeaderspublic int size()
HttpHeaderssize in class HttpHeaderspublic Set<String> names()
HttpHeadersSet that contains the names of all headers in this object. Note that modifying the
returned Set will not affect the state of this object. If you intend to enumerate over the header
entries only, use HttpHeaders.iterator() instead, which has much less overhead.names in class HttpHeaderspublic HttpHeaders add(String name, Object value)
add in class HttpHeadersHttpHeaders.add(CharSequence, Object)public HttpHeaders add(String name, Iterable<?> values)
add in class HttpHeadersHttpHeaders.add(CharSequence, Iterable)public HttpHeaders addInt(CharSequence name, int value)
HttpHeadersname to value.addInt in class HttpHeadersname - The name to modifyvalue - The valuethispublic HttpHeaders addShort(CharSequence name, short value)
HttpHeadersname to value.addShort in class HttpHeadersname - The name to modifyvalue - The valuethispublic HttpHeaders set(String name, Object value)
set in class HttpHeadersHttpHeaders.set(CharSequence, Object)public HttpHeaders set(String name, Iterable<?> values)
set in class HttpHeadersHttpHeaders.set(CharSequence, Iterable)public HttpHeaders setInt(CharSequence name, int value)
HttpHeadersname to value. This will remove all previous values associated with name.setInt in class HttpHeadersname - The name to modifyvalue - The valuethispublic HttpHeaders setShort(CharSequence name, short value)
HttpHeadersname to value. This will remove all previous values associated with name.setShort in class HttpHeadersname - The name to modifyvalue - The valuethispublic HttpHeaders remove(String name)
remove in class HttpHeadersHttpHeaders.remove(CharSequence)public HttpHeaders clear()
HttpHeadersHttpMessage.clear in class HttpHeadersthispublic Iterator<Map.Entry<CharSequence,CharSequence>> iteratorCharSequence()
iteratorCharSequence in class HttpHeadersCopyright © 2008–2017 The Netty Project. All rights reserved.