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, setTransferEncodingChunked
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final EmptyHttpHeaders INSTANCE
public String get(String name)
get
in class HttpHeaders
HttpHeaders.get(CharSequence)
public Integer getInt(CharSequence name)
HttpHeaders
getInt
in class HttpHeaders
name
- 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)
HttpHeaders
getInt
in class HttpHeaders
name
- 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)
HttpHeaders
getShort
in class HttpHeaders
name
- 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)
HttpHeaders
getShort
in class HttpHeaders
name
- 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)
HttpHeaders
getTimeMillis
in class HttpHeaders
name
- 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)
HttpHeaders
getTimeMillis
in class HttpHeaders
name
- 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 HttpHeaders
HttpHeaders.getAll(CharSequence)
public List<Map.Entry<String,String>> entries()
HttpHeaders
List
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 HttpHeaders
HttpHeaders.iteratorCharSequence()
public boolean contains(String name)
contains
in class HttpHeaders
HttpHeaders.contains(CharSequence)
public boolean isEmpty()
HttpHeaders
isEmpty
in class HttpHeaders
public int size()
HttpHeaders
size
in class HttpHeaders
public Set<String> names()
HttpHeaders
Set
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 HttpHeaders
public HttpHeaders add(String name, Object value)
add
in class HttpHeaders
HttpHeaders.add(CharSequence, Object)
public HttpHeaders add(String name, Iterable<?> values)
add
in class HttpHeaders
HttpHeaders.add(CharSequence, Iterable)
public HttpHeaders addInt(CharSequence name, int value)
HttpHeaders
name
to value
.addInt
in class HttpHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addShort(CharSequence name, short value)
HttpHeaders
name
to value
.addShort
in class HttpHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders set(String name, Object value)
set
in class HttpHeaders
HttpHeaders.set(CharSequence, Object)
public HttpHeaders set(String name, Iterable<?> values)
set
in class HttpHeaders
HttpHeaders.set(CharSequence, Iterable)
public HttpHeaders setInt(CharSequence name, int value)
HttpHeaders
name
to value
. This will remove all previous values associated with name
.setInt
in class HttpHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setShort(CharSequence name, short value)
HttpHeaders
name
to value
. This will remove all previous values associated with name
.setShort
in class HttpHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders remove(String name)
remove
in class HttpHeaders
HttpHeaders.remove(CharSequence)
public HttpHeaders clear()
HttpHeaders
HttpMessage
.clear
in class HttpHeaders
this
public Iterator<Map.Entry<CharSequence,CharSequence>> iteratorCharSequence()
iteratorCharSequence
in class HttpHeaders
Copyright © 2008–2017 The Netty Project. All rights reserved.