public class EmptyHttpHeaders extends HttpHeaders
HttpHeaders.Names, HttpHeaders.Values
限定符和类型 | 字段和说明 |
---|---|
static EmptyHttpHeaders |
INSTANCE |
EMPTY_HEADERS
限定符 | 构造器和说明 |
---|---|
protected |
EmptyHttpHeaders() |
限定符和类型 | 方法和说明 |
---|---|
HttpHeaders |
add(java.lang.String name,
java.lang.Iterable<?> values) |
HttpHeaders |
add(java.lang.String name,
java.lang.Object value) |
HttpHeaders |
addInt(java.lang.CharSequence name,
int value)
Add the
name to value . |
HttpHeaders |
addShort(java.lang.CharSequence name,
short value)
Add the
name to value . |
HttpHeaders |
clear()
Removes all headers from this
HttpMessage . |
boolean |
contains(java.lang.String name) |
java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> |
entries()
Returns a new
List that contains all headers in this object. |
java.lang.String |
get(java.lang.String name) |
java.util.List<java.lang.String> |
getAll(java.lang.String name) |
java.lang.Integer |
getInt(java.lang.CharSequence name)
Returns the integer value of a header with the specified name.
|
int |
getInt(java.lang.CharSequence name,
int defaultValue)
Returns the integer value of a header with the specified name.
|
java.lang.Short |
getShort(java.lang.CharSequence name)
Returns the short value of a header with the specified name.
|
short |
getShort(java.lang.CharSequence name,
short defaultValue)
Returns the short value of a header with the specified name.
|
java.lang.Long |
getTimeMillis(java.lang.CharSequence name)
Returns the date value of a header with the specified name.
|
long |
getTimeMillis(java.lang.CharSequence name,
long defaultValue)
Returns the date value of a header with the specified name.
|
boolean |
isEmpty()
Checks if no header exists.
|
java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> |
iterator() |
java.util.Iterator<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>> |
iteratorCharSequence() |
java.util.Set<java.lang.String> |
names()
Returns a new
Set that contains the names of all headers in this object. |
HttpHeaders |
remove(java.lang.String name) |
HttpHeaders |
set(java.lang.String name,
java.lang.Iterable<?> values) |
HttpHeaders |
set(java.lang.String name,
java.lang.Object value) |
HttpHeaders |
setInt(java.lang.CharSequence name,
int value)
Set the
name to value . |
HttpHeaders |
setShort(java.lang.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, 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
public static final EmptyHttpHeaders INSTANCE
public java.lang.String get(java.lang.String name)
get
在类中 HttpHeaders
HttpHeaders.get(CharSequence)
public java.lang.Integer getInt(java.lang.CharSequence name)
HttpHeaders
getInt
在类中 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(java.lang.CharSequence name, int defaultValue)
HttpHeaders
getInt
在类中 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 java.lang.Short getShort(java.lang.CharSequence name)
HttpHeaders
getShort
在类中 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(java.lang.CharSequence name, short defaultValue)
HttpHeaders
getShort
在类中 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 java.lang.Long getTimeMillis(java.lang.CharSequence name)
HttpHeaders
getTimeMillis
在类中 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(java.lang.CharSequence name, long defaultValue)
HttpHeaders
getTimeMillis
在类中 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 java.util.List<java.lang.String> getAll(java.lang.String name)
getAll
在类中 HttpHeaders
HttpHeaders.getAll(CharSequence)
public java.util.List<java.util.Map.Entry<java.lang.String,java.lang.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
在类中 HttpHeaders
HttpHeaders.iteratorCharSequence()
public boolean contains(java.lang.String name)
contains
在类中 HttpHeaders
HttpHeaders.contains(CharSequence)
public boolean isEmpty()
HttpHeaders
isEmpty
在类中 HttpHeaders
public int size()
HttpHeaders
size
在类中 HttpHeaders
public java.util.Set<java.lang.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
在类中 HttpHeaders
public HttpHeaders add(java.lang.String name, java.lang.Object value)
add
在类中 HttpHeaders
HttpHeaders.add(CharSequence, Object)
public HttpHeaders add(java.lang.String name, java.lang.Iterable<?> values)
add
在类中 HttpHeaders
HttpHeaders.add(CharSequence, Iterable)
public HttpHeaders addInt(java.lang.CharSequence name, int value)
HttpHeaders
name
to value
.addInt
在类中 HttpHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders addShort(java.lang.CharSequence name, short value)
HttpHeaders
name
to value
.addShort
在类中 HttpHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders set(java.lang.String name, java.lang.Object value)
set
在类中 HttpHeaders
HttpHeaders.set(CharSequence, Object)
public HttpHeaders set(java.lang.String name, java.lang.Iterable<?> values)
set
在类中 HttpHeaders
HttpHeaders.set(CharSequence, Iterable)
public HttpHeaders setInt(java.lang.CharSequence name, int value)
HttpHeaders
name
to value
. This will remove all previous values associated with name
.setInt
在类中 HttpHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders setShort(java.lang.CharSequence name, short value)
HttpHeaders
name
to value
. This will remove all previous values associated with name
.setShort
在类中 HttpHeaders
name
- The name to modifyvalue
- The valuethis
public HttpHeaders remove(java.lang.String name)
remove
在类中 HttpHeaders
HttpHeaders.remove(CharSequence)
public HttpHeaders clear()
HttpHeaders
HttpMessage
.clear
在类中 HttpHeaders
this
public java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> iterator()
iterator
在接口中 java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>>
iterator
在类中 HttpHeaders
public java.util.Iterator<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>> iteratorCharSequence()
iteratorCharSequence
在类中 HttpHeaders