public class DefaultHttpHeaders extends HttpHeaders
HttpHeaders.Names, HttpHeaders.Values| Modifier and Type | Field and Description |
|---|---|
protected boolean |
validate |
EMPTY_HEADERS| Constructor and Description |
|---|
DefaultHttpHeaders() |
DefaultHttpHeaders(boolean validate) |
| Modifier and Type | Method and Description |
|---|---|
HttpHeaders |
add(CharSequence name,
Iterable<?> values)
Adds a new header with the specified name and values.
|
HttpHeaders |
add(CharSequence name,
Object value)
Adds a new header with the specified name and value.
|
HttpHeaders |
add(HttpHeaders headers)
Adds all header entries of the specified
headers. |
HttpHeaders |
clear()
Removes all headers from this
HttpMessage. |
boolean |
contains(CharSequence name)
Checks to see if there is a header with the specified name
|
boolean |
contains(CharSequence name,
CharSequence value,
boolean ignoreCaseValue)
Returns
true if a header with the name and value exists. |
List<Map.Entry<String,String>> |
entries()
Returns a new
List that contains all headers in this object. |
String |
get(CharSequence name)
Returns the value of a header with the specified name.
|
List<String> |
getAll(CharSequence name)
Returns the values of headers with the specified name
|
boolean |
isEmpty()
Checks if no header exists.
|
Iterator<Map.Entry<String,String>> |
iterator() |
Set<String> |
names()
Returns a new
Set that contains the names of all headers in this object. |
HttpHeaders |
remove(CharSequence name)
Removes the header with the specified name.
|
HttpHeaders |
set(CharSequence name,
Iterable<?> values)
Sets a header with the specified name and values.
|
HttpHeaders |
set(CharSequence name,
Object value)
Sets a header with the specified name and value.
|
HttpHeaders |
set(HttpHeaders headers)
Cleans the current header entries and copies all header entries of the specified
headers. |
addDateHeader, addHeader, addIntHeader, clearHeaders, encodeAscii, equalsIgnoreCase, getContentLength, getContentLength, getDate, getDate, getDateHeader, getDateHeader, getHeader, getHeader, getHost, getHost, getIntHeader, getIntHeader, is100ContinueExpected, isContentLengthSet, isKeepAlive, isTransferEncodingChunked, newEntity, removeHeader, removeTransferEncodingChunked, set100ContinueExpected, set100ContinueExpected, setContentLength, setDate, setDateHeader, setDateHeader, setHeader, setHeader, setHost, setIntHeader, setIntHeader, setKeepAlive, setTransferEncodingChunkedpublic DefaultHttpHeaders()
public DefaultHttpHeaders(boolean validate)
public HttpHeaders add(HttpHeaders headers)
HttpHeadersheaders.add in class HttpHeadersthispublic HttpHeaders set(HttpHeaders headers)
HttpHeadersheaders.set in class HttpHeadersthispublic HttpHeaders add(CharSequence name, Object value)
HttpHeadersString, it is converted
into a String by Object.toString(), except in the cases
of Date and Calendar, which are formatted to the date
format defined in RFC2616.add in class HttpHeadersname - The name of the header being addedvalue - The value of the header being addedthispublic HttpHeaders add(CharSequence name, Iterable<?> values)
HttpHeaders
for (Object v: values) {
if (v == null) {
break;
}
headers.add(name, v);
}
add in class HttpHeadersname - The name of the headers being setvalues - The values of the headers being setthispublic HttpHeaders remove(CharSequence name)
HttpHeadersremove in class HttpHeadersname - The name of the header to removethispublic HttpHeaders set(CharSequence name, Object value)
HttpHeadersString, it is converted into a
String by Object.toString(), except for Date
and Calendar, which are formatted to the date format defined in
RFC2616.set in class HttpHeadersname - The name of the header being setvalue - The value of the header being setthispublic HttpHeaders set(CharSequence name, Iterable<?> values)
HttpHeaders
headers.remove(name);
for (Object v: values) {
if (v == null) {
break;
}
headers.add(name, v);
}
set in class HttpHeadersname - The name of the headers being setvalues - The values of the headers being setthispublic HttpHeaders clear()
HttpHeadersHttpMessage.clear in class HttpHeadersthispublic String get(CharSequence name)
HttpHeadersget in class HttpHeadersname - The name of the header to searchnull if there is no such headerpublic List<String> getAll(CharSequence name)
HttpHeadersgetAll in class HttpHeadersname - The name of the headers to searchList of header values which will be empty if no values
are foundpublic 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 Iterable.iterator() instead, which has much less overhead.entries in class HttpHeaderspublic boolean contains(CharSequence name)
HttpHeaderscontains in class HttpHeadersname - The name of the header to search forpublic boolean isEmpty()
HttpHeadersisEmpty in class HttpHeaderspublic boolean contains(CharSequence name, CharSequence value, boolean ignoreCaseValue)
HttpHeaderstrue if a header with the name and value exists.contains in class HttpHeadersname - the headernamevalue - the valueignoreCaseValue - true if case should be ignoredtrue if it contains it false otherwisepublic 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 Iterable.iterator() instead, which has much less overhead.names in class HttpHeadersCopyright © 2008–2013 The Netty Project. All rights reserved.