public class DefaultHttpHeaders extends HttpHeaders
HttpHeaders.Names, HttpHeaders.Values| 限定符和类型 | 字段和说明 | 
|---|---|
| protected boolean | validate | 
EMPTY_HEADERS| 构造器和说明 | 
|---|
| DefaultHttpHeaders() | 
| DefaultHttpHeaders(boolean validate) | 
| 限定符和类型 | 方法和说明 | 
|---|---|
| HttpHeaders | add(java.lang.String name,
   java.lang.Iterable<?> values)Adds a new header with the specified name and values. | 
| HttpHeaders | add(java.lang.String name,
   java.lang.Object value)Adds a new header with the specified name and value. | 
| HttpHeaders | clear()Removes all headers from this  HttpMessage. | 
| boolean | contains(java.lang.String name)Checks to see if there is a header with the specified name | 
| boolean | contains(java.lang.String name,
        java.lang.String value,
        boolean ignoreCaseValue)Returns  trueif a header with the name and value exists. | 
| java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> | entries()Returns a new  Listthat contains all headers in this object. | 
| java.lang.String | get(java.lang.String name)Returns the value of a header with the specified name. | 
| java.util.List<java.lang.String> | getAll(java.lang.String name)Returns the values of headers 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.Set<java.lang.String> | names()Returns a new  Setthat contains the names of all headers in this object. | 
| HttpHeaders | remove(java.lang.String name)Removes the header with the specified name. | 
| HttpHeaders | set(java.lang.String name,
   java.lang.Iterable<?> values)Sets a header with the specified name and values. | 
| HttpHeaders | set(java.lang.String name,
   java.lang.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(java.lang.String name, java.lang.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 在类中 HttpHeadersname - The name of the header being addedvalue - The value of the header being addedthispublic HttpHeaders add(java.lang.String name, java.lang.Iterable<?> values)
HttpHeaders
 for (Object v: values) {
     if (v == null) {
         break;
     }
     headers.add(name, v);
 }
 add 在类中 HttpHeadersname - The name of the headers being setvalues - The values of the headers being setthispublic HttpHeaders remove(java.lang.String name)
HttpHeadersremove 在类中 HttpHeadersname - The name of the header to removethispublic HttpHeaders set(java.lang.String name, java.lang.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 在类中 HttpHeadersname - The name of the header being setvalue - The value of the header being setthispublic HttpHeaders set(java.lang.String name, java.lang.Iterable<?> values)
HttpHeaders
 headers.remove(name);
 for (Object v: values) {
     if (v == null) {
         break;
     }
     headers.add(name, v);
 }
 set 在类中 HttpHeadersname - The name of the headers being setvalues - The values of the headers being setthispublic HttpHeaders clear()
HttpHeadersHttpMessage.clear 在类中 HttpHeadersthispublic java.lang.String get(java.lang.String name)
HttpHeadersget 在类中 HttpHeadersname - The name of the header to searchnull if there is no such headerpublic java.util.List<java.lang.String> getAll(java.lang.String name)
HttpHeadersgetAll 在类中 HttpHeadersname - The name of the headers to searchList of header values which will be empty if no values
         are foundpublic java.util.List<java.util.Map.Entry<java.lang.String,java.lang.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 在类中 HttpHeaderspublic java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> iterator()
public boolean contains(java.lang.String name)
HttpHeaderscontains 在类中 HttpHeadersname - The name of the header to search forpublic boolean isEmpty()
HttpHeadersisEmpty 在类中 HttpHeaderspublic boolean contains(java.lang.String name,
               java.lang.String value,
               boolean ignoreCaseValue)
HttpHeaderstrue if a header with the name and value exists.contains 在类中 HttpHeadersname - the headernamevalue - the valueignoreCaseValue - true if case should be ignoredtrue if it contains it false otherwisepublic java.util.Set<java.lang.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 在类中 HttpHeaders