
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(String name,
Iterable<?> values)
Adds a new header with the specified name and values.
|
HttpHeaders |
add(String name,
Object value)
Adds a new header with the specified name and value.
|
HttpHeaders |
clear()
Removes all headers from this
HttpMessage. |
boolean |
contains(String name)
Checks to see if there is a header with the specified name
|
boolean |
contains(String name,
String value,
boolean ignoreCaseValue)
Returns
true if a header with the name and value exists. |
List<Map.Entry<String,String>> |
entries()
Returns the all headers that this message contains.
|
String |
get(String name)
Returns the value of a header with the specified name.
|
List<String> |
getAll(String 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()
Gets a
Set of all header names that this message contains |
HttpHeaders |
remove(String name)
Removes the header with the specified name.
|
HttpHeaders |
set(String name,
Iterable<?> values)
Sets a header with the specified name and values.
|
HttpHeaders |
set(String name,
Object value)
Sets a header with the specified name and value.
|
add, addDateHeader, addHeader, addIntHeader, clearHeaders, getContentLength, getContentLength, getDate, getDate, getDateHeader, getDateHeader, getHeader, getHeader, getHost, getHost, getIntHeader, getIntHeader, is100ContinueExpected, isContentLengthSet, isKeepAlive, isTransferEncodingChunked, removeHeader, removeTransferEncodingChunked, set, set100ContinueExpected, set100ContinueExpected, setContentLength, setDate, setDateHeader, setDateHeader, setHeader, setHeader, setHost, setIntHeader, setIntHeader, setKeepAlive, setTransferEncodingChunkedpublic DefaultHttpHeaders()
public DefaultHttpHeaders(boolean validate)
public HttpHeaders add(String 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(String 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(String name)
HttpHeadersremove in class HttpHeadersname - The name of the header to removethispublic HttpHeaders set(String 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(String 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(String name)
HttpHeadersget in class HttpHeadersname - The name of the header to searchnull if there is no such headerpublic List<String> getAll(String 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()
HttpHeadersentries in class HttpHeadersList of the header name-value entries, which will be
empty if no pairs are foundpublic boolean contains(String name)
HttpHeaderscontains in class HttpHeadersname - The name of the header to search forpublic boolean isEmpty()
HttpHeadersisEmpty in class HttpHeaderspublic boolean contains(String name, String 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 of all header names that this message containsnames in class HttpHeadersSet of all header namesCopyright © 2008-2014 The Netty Project. All Rights Reserved.