GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Use
  • Tree
  • Deprecated
  • Index
  • Search
  • Help
  • io.netty.handler.codec.http
  • DefaultHttpHeaders

This view

  • Original page
  • New address

GeezerVison is showing netty.io — DefaultHttpHeaders (Netty API Reference (4.1.141.Final))

Class DefaultHttpHeaders

java.lang.Object
io.netty.handler.codec.http.HttpHeaders
io.netty.handler.codec.http.DefaultHttpHeaders
All Implemented Interfaces:
Iterable<Map.Entry<String,String>>
Direct Known Subclasses:
CombinedHttpHeaders

public class DefaultHttpHeaders extends HttpHeaders
Default implementation of HttpHeaders.
  • Nested Class Summary

    Nested classes/interfaces inherited from class HttpHeaders

    HttpHeaders.Names, HttpHeaders.Values
    Modifier and Type
    Class
    Description
    static final class 
    HttpHeaders.Names
    Deprecated.
    Use HttpHeaderNames instead.
    static final class 
    HttpHeaders.Values
    Deprecated.
    Use HttpHeaderValues instead.
  • Field Summary

    Fields inherited from class HttpHeaders

    EMPTY_HEADERS
    Modifier and Type
    Field
    Description
    static final HttpHeaders
    EMPTY_HEADERS
    Deprecated.
    Use EmptyHttpHeaders.INSTANCE.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    DefaultHttpHeaders()
    Create a new, empty HTTP headers object.
     
    DefaultHttpHeaders(boolean validate)
    Deprecated.
    Prefer using the DefaultHttpHeaders() constructor instead, to always have validation enabled.
    protected
    DefaultHttpHeaders(boolean validateValues, DefaultHeaders.NameValidator<CharSequence> nameValidator)
    Create an HTTP headers object with the given name validator.
    protected
    DefaultHttpHeaders(DefaultHeaders.NameValidator<CharSequence> nameValidator, DefaultHeaders.ValueValidator<CharSequence> valueValidator)
    Create an HTTP headers object with the given name and value validators.
    protected
    DefaultHttpHeaders(DefaultHeaders.NameValidator<CharSequence> nameValidator, DefaultHeaders.ValueValidator<CharSequence> valueValidator, int sizeHint)
    Create an HTTP headers object with the given name and value validators.
    protected
    DefaultHttpHeaders(DefaultHeaders<CharSequence, CharSequence, ?> headers)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    HttpHeaders
    add(HttpHeaders headers)
    Adds all header entries of the specified headers.
    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(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(CharSequence name)
    Checks to see if there is a header with the specified name
    boolean
    contains(CharSequence name, CharSequence value, boolean ignoreCase)
    Returns true if a header with the name and value exists, false otherwise.
    boolean
    contains(String name)
     
    boolean
    contains(String name, String value, boolean ignoreCase)
     
    HttpHeaders
    copy()
    Returns a deep copy of the passed in HttpHeaders.
    List<Map.Entry<String,String>>
    entries()
    Returns a new List that contains all headers in this object.
    boolean
    equals(Object o)
     
    String
    get(CharSequence name)
    Returns the value of a header with the specified name.
    String
    get(String name)
     
    List<String>
    getAll(CharSequence name)
    Returns the values of headers with the specified 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.
    int
    hashCode()
     
    boolean
    isEmpty()
    Checks if no header exists.
    Iterator<Map.Entry<String,String>>
    iterator()
    Deprecated.
    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(CharSequence name)
    Removes the header with the specified name.
    HttpHeaders
    remove(String name)
     
    HttpHeaders
    set(HttpHeaders headers)
    Cleans the current header entries and copies all header entries of the specified headers.
    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(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.
    Headers<CharSequence, CharSequence, ?>
    unwrap()
     
    Iterator<CharSequence>
    valueCharSequenceIterator(CharSequence name)
    Equivalent to HttpHeaders.getAll(String) but it is possible that no intermediate list is generated.
    Iterator<String>
    valueStringIterator(CharSequence name)
    Equivalent to HttpHeaders.getAll(String) but it is possible that no intermediate list is generated.

    Methods inherited from class HttpHeaders

    addDateHeader, addDateHeader, addHeader, addHeader, addIntHeader, addIntHeader, clearHeaders, containsValue, encodeAscii, equalsIgnoreCase, get, 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, removeHeader, removeHeader, removeTransferEncodingChunked, set100ContinueExpected, set100ContinueExpected, setAll, setContentLength, setDate, setDateHeader, setDateHeader, setDateHeader, setDateHeader, setHeader, setHeader, setHeader, setHeader, setHost, setHost, setIntHeader, setIntHeader, setIntHeader, setIntHeader, setKeepAlive, setTransferEncodingChunked, toString
    Modifier and Type
    Method
    Description
    static void
    addDateHeader(HttpMessage message, CharSequence name, Date value)
    Deprecated.
    Use HttpHeaders.add(CharSequence, Object) instead.
    static void
    addDateHeader(HttpMessage message, String name, Date value)
    Deprecated.
    Use HttpHeaders.add(CharSequence, Object) instead.
    static void
    addHeader(HttpMessage message, CharSequence name, Object value)
    Deprecated.
    Use HttpHeaders.add(CharSequence, Object) instead.
    static void
    addHeader(HttpMessage message, String name, Object value)
    Deprecated.
    Use HttpHeaders.add(CharSequence, Object) instead.
    static void
    addIntHeader(HttpMessage message, CharSequence name, int value)
    Deprecated.
    Use HttpHeaders.addInt(CharSequence, int) instead.
    static void
    addIntHeader(HttpMessage message, String name, int value)
    Deprecated.
    Use HttpHeaders.add(CharSequence, Iterable) instead.
    static void
    clearHeaders(HttpMessage message)
    Deprecated.
    Use HttpHeaders.clear() instead.
    boolean
    containsValue(CharSequence name, CharSequence value, boolean ignoreCase)
    Returns true if a header with the name and value exists, false otherwise.
    static void
    encodeAscii(CharSequence seq, ByteBuf buf)
    Deprecated.
    static boolean
    equalsIgnoreCase(CharSequence name1, CharSequence name2)
    Deprecated.
    Use AsciiString.contentEqualsIgnoreCase(CharSequence, CharSequence) instead.
    String
    get(CharSequence name, String defaultValue)
    Returns the value of a header with the specified name.
    final List<String>
    getAllAsString(CharSequence name)
    Headers.getAll(Object) and convert each element of List to a String.
    final String
    getAsString(CharSequence name)
    Headers.get(Object) and convert the result to a String.
    static long
    getContentLength(HttpMessage message)
    Deprecated.
    Use HttpUtil.getContentLength(HttpMessage) instead.
    static long
    getContentLength(HttpMessage message, long defaultValue)
    Deprecated.
    Use HttpUtil.getContentLength(HttpMessage, long) instead.
    static Date
    getDate(HttpMessage message)
    Deprecated.
    Use HttpHeaders.getTimeMillis(CharSequence) instead.
    static Date
    getDate(HttpMessage message, Date defaultValue)
    Deprecated.
    Use HttpHeaders.getTimeMillis(CharSequence, long) instead.
    static Date
    getDateHeader(HttpMessage message, CharSequence name)
    Deprecated.
    Use HttpHeaders.getTimeMillis(CharSequence) instead.
    static Date
    getDateHeader(HttpMessage message, CharSequence name, Date defaultValue)
    Deprecated.
    Use HttpHeaders.getTimeMillis(CharSequence, long) instead.
    static Date
    getDateHeader(HttpMessage message, String name)
    Deprecated.
    Use HttpHeaders.getTimeMillis(CharSequence) instead.
    static Date
    getDateHeader(HttpMessage message, String name, Date defaultValue)
    Deprecated.
    Use HttpHeaders.getTimeMillis(CharSequence, long) instead.
    static String
    getHeader(HttpMessage message, CharSequence name)
    Deprecated.
    Use HttpHeaders.get(CharSequence) instead.
    static String
    getHeader(HttpMessage message, CharSequence name, String defaultValue)
    Deprecated.
    Use HttpHeaders.get(CharSequence, String) instead.
    static String
    getHeader(HttpMessage message, String name)
    Deprecated.
    Use HttpHeaders.get(CharSequence) instead.
    static String
    getHeader(HttpMessage message, String name, String defaultValue)
    Deprecated.
    Use HttpHeaders.get(CharSequence, String) instead.
    static String
    getHost(HttpMessage message)
    Deprecated.
    Use HttpHeaders.get(CharSequence) instead.
    static String
    getHost(HttpMessage message, String defaultValue)
    Deprecated.
    Use HttpHeaders.get(CharSequence, String) instead.
    static int
    getIntHeader(HttpMessage message, CharSequence name)
    Deprecated.
    Use HttpHeaders.getInt(CharSequence) instead.
    static int
    getIntHeader(HttpMessage message, CharSequence name, int defaultValue)
    Deprecated.
    Use HttpHeaders.getInt(CharSequence, int) instead.
    static int
    getIntHeader(HttpMessage message, String name)
    Deprecated.
    Use HttpHeaders.getInt(CharSequence) instead.
    static int
    getIntHeader(HttpMessage message, String name, int defaultValue)
    Deprecated.
    Use HttpHeaders.getInt(CharSequence, int) instead.
    static boolean
    is100ContinueExpected(HttpMessage message)
    Deprecated.
    Use HttpUtil.is100ContinueExpected(HttpMessage) instead.
    static boolean
    isContentLengthSet(HttpMessage m)
    Deprecated.
    Use HttpUtil.isContentLengthSet(HttpMessage) instead.
    static boolean
    isKeepAlive(HttpMessage message)
    Deprecated.
    Use HttpUtil.isKeepAlive(HttpMessage) instead.
    static boolean
    isTransferEncodingChunked(HttpMessage message)
    Deprecated.
    Use HttpUtil.isTransferEncodingChunked(HttpMessage) instead.
    final Iterator<Map.Entry<String,String>>
    iteratorAsString()
    Iterator that converts each Map.Entry's key and value to a String.
    static CharSequence
    newEntity(String name)
    Deprecated.
    Use AsciiString instead.
    static void
    removeHeader(HttpMessage message, CharSequence name)
    Deprecated.
    Use HttpHeaders.remove(CharSequence) instead.
    static void
    removeHeader(HttpMessage message, String name)
    Deprecated.
    Use HttpHeaders.remove(CharSequence) instead.
    static void
    removeTransferEncodingChunked(HttpMessage m)
    Deprecated.
    Use HttpUtil.setTransferEncodingChunked(HttpMessage, boolean) instead.
    static void
    set100ContinueExpected(HttpMessage message)
    Deprecated.
    Use HttpUtil.set100ContinueExpected(HttpMessage, boolean) instead.
    static void
    set100ContinueExpected(HttpMessage message, boolean set)
    Deprecated.
    Use HttpUtil.set100ContinueExpected(HttpMessage, boolean) instead.
    HttpHeaders
    setAll(HttpHeaders headers)
    Retains all current headers but calls HttpHeaders.set(String, Object) for each entry in headers
    static void
    setContentLength(HttpMessage message, long length)
    Deprecated.
    Use HttpUtil.setContentLength(HttpMessage, long) instead.
    static void
    setDate(HttpMessage message, Date value)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Object) instead.
    static void
    setDateHeader(HttpMessage message, CharSequence name, Iterable<Date> values)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Iterable) instead.
    static void
    setDateHeader(HttpMessage message, CharSequence name, Date value)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Object) instead.
    static void
    setDateHeader(HttpMessage message, String name, Iterable<Date> values)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Iterable) instead.
    static void
    setDateHeader(HttpMessage message, String name, Date value)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Object) instead.
    static void
    setHeader(HttpMessage message, CharSequence name, Iterable<?> values)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Iterable) instead.
    static void
    setHeader(HttpMessage message, CharSequence name, Object value)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Object) instead.
    static void
    setHeader(HttpMessage message, String name, Iterable<?> values)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Iterable) instead.
    static void
    setHeader(HttpMessage message, String name, Object value)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Object) instead.
    static void
    setHost(HttpMessage message, CharSequence value)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Object) instead.
    static void
    setHost(HttpMessage message, String value)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Object) instead.
    static void
    setIntHeader(HttpMessage message, CharSequence name, int value)
    Deprecated.
    Use HttpHeaders.setInt(CharSequence, int) instead.
    static void
    setIntHeader(HttpMessage message, CharSequence name, Iterable<Integer> values)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Iterable) instead.
    static void
    setIntHeader(HttpMessage message, String name, int value)
    Deprecated.
    Use HttpHeaders.setInt(CharSequence, int) instead.
    static void
    setIntHeader(HttpMessage message, String name, Iterable<Integer> values)
    Deprecated.
    Use HttpHeaders.set(CharSequence, Iterable) instead.
    static void
    setKeepAlive(HttpMessage message, boolean keepAlive)
    Deprecated.
    Use HttpUtil.setKeepAlive(HttpMessage, boolean) instead.
    static void
    setTransferEncodingChunked(HttpMessage m)
    Deprecated.
    Use HttpUtil.setTransferEncodingChunked(HttpMessage, boolean) instead.
    String
    toString()
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface Iterable

    forEach, spliterator
  • Constructor Details

    • DefaultHttpHeaders

      public DefaultHttpHeaders()
      Create a new, empty HTTP headers object.

      Header names and values are validated as they are added, to ensure they are compliant with the HTTP protocol.

    • DefaultHttpHeaders

      @Deprecated public DefaultHttpHeaders(boolean validate)
      Deprecated.
      Prefer using the DefaultHttpHeaders() constructor instead, to always have validation enabled.
      Warning! Setting validate to false will mean that Netty won't validate invalid input: '&' protect against user-supplied header values that are malicious. This can leave your server implementation vulnerable to CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting') . When disabling this validation, it is the responsibility of the caller to ensure that the values supplied do not contain a non-url-escaped carriage return (CR) and/or line feed (LF) characters.
      Parameters:
      validate - Should Netty validate header values to ensure they aren't malicious.
    • DefaultHttpHeaders

      protected DefaultHttpHeaders(boolean validateValues, DefaultHeaders.NameValidator<CharSequence> nameValidator)
      Create an HTTP headers object with the given name validator.

      Warning! It is strongly recommended that the name validator implement validation that is at least as strict as HttpHeaderValidationUtil.validateToken(CharSequence). It is also strongly recommended that validateValues is enabled.

      Without these validations in place, your code can be susceptible to CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting') . It is the responsibility of the caller to ensure that the values supplied do not contain a non-url-escaped carriage return (CR) and/or line feed (LF) characters.

      Parameters:
      validateValues - Should Netty validate header values to ensure they aren't malicious.
      nameValidator - The DefaultHeaders.NameValidator to use, never
      invalid @code
      {@code null.
    • DefaultHttpHeaders

      protected DefaultHttpHeaders(DefaultHeaders.NameValidator<CharSequence> nameValidator, DefaultHeaders.ValueValidator<CharSequence> valueValidator)
      Create an HTTP headers object with the given name and value validators.

      Warning! It is strongly recommended that the name validator implement validation that is at least as strict as HttpHeaderValidationUtil.validateToken(CharSequence). And that the value validator is at least as strict as HttpHeaderValidationUtil.validateValidHeaderValue(CharSequence).

      Without these validations in place, your code can be susceptible to CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting') . It is the responsibility of the caller to ensure that the values supplied do not contain a non-url-escaped carriage return (CR) and/or line feed (LF) characters.

      Parameters:
      nameValidator - The DefaultHeaders.NameValidator to use, never null.
      valueValidator - The DefaultHeaders.ValueValidator to use, never null.
    • DefaultHttpHeaders

      protected DefaultHttpHeaders(DefaultHeaders.NameValidator<CharSequence> nameValidator, DefaultHeaders.ValueValidator<CharSequence> valueValidator, int sizeHint)
      Create an HTTP headers object with the given name and value validators.

      Warning! It is strongly recommended that the name validator implement validation that is at least as strict as HttpHeaderValidationUtil.validateToken(CharSequence). And that the value validator is at least as strict as HttpHeaderValidationUtil.validateValidHeaderValue(CharSequence).

      Without these validations in place, your code can be susceptible to CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting') . It is the responsibility of the caller to ensure that the values supplied do not contain a non-url-escaped carriage return (CR) and/or line feed (LF) characters.

      Parameters:
      nameValidator - The DefaultHeaders.NameValidator to use, never null.
      valueValidator - The DefaultHeaders.ValueValidator to use, never null.
      sizeHint - A hint about the anticipated number of entries.
    • DefaultHttpHeaders

      protected DefaultHttpHeaders(DefaultHeaders<CharSequence, CharSequence, ?> headers)
  • Method Details

    • unwrap

      public Headers<CharSequence, CharSequence, ?> unwrap()
    • add

      public HttpHeaders add(HttpHeaders headers)
      Description copied from class: HttpHeaders
      Adds all header entries of the specified headers.
      Overrides:
      add in class HttpHeaders
      Returns:
      this
    • set

      public HttpHeaders set(HttpHeaders headers)
      Description copied from class: HttpHeaders
      Cleans the current header entries and copies all header entries of the specified headers.
      Overrides:
      set in class HttpHeaders
      Returns:
      this
    • add

      public HttpHeaders add(String name, Object value)
      Specified by:
      add in class HttpHeaders
      See Also:
      • HttpHeaders.add(CharSequence, Object)
    • add

      public HttpHeaders add(CharSequence name, Object value)
      Description copied from class: HttpHeaders
      Adds a new header with the specified name and value. If the specified value is not a String, 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.
      Overrides:
      add in class HttpHeaders
      Parameters:
      name - The name of the header being added
      value - The value of the header being added
      Returns:
      this
    • add

      public HttpHeaders add(String name, Iterable<?> values)
      Specified by:
      add in class HttpHeaders
      See Also:
      • HttpHeaders.add(CharSequence, Iterable)
    • add

      public HttpHeaders add(CharSequence name, Iterable<?> values)
      Description copied from class: HttpHeaders
      Adds a new header with the specified name and values. This getMethod can be represented approximately as the following code:
      for (Object v: values) {
          if (v == null) {
              break;
          }
          headers.add(name, v);
      }
      
      Overrides:
      add in class HttpHeaders
      Parameters:
      name - The name of the headers being set
      values - The values of the headers being set
      Returns:
      this
    • addInt

      public HttpHeaders addInt(CharSequence name, int value)
      Description copied from class: HttpHeaders
      Add the name to value.
      Specified by:
      addInt in class HttpHeaders
      Parameters:
      name - The name to modify
      value - The value
      Returns:
      this
    • addShort

      public HttpHeaders addShort(CharSequence name, short value)
      Description copied from class: HttpHeaders
      Add the name to value.
      Specified by:
      addShort in class HttpHeaders
      Parameters:
      name - The name to modify
      value - The value
      Returns:
      this
    • remove

      public HttpHeaders remove(String name)
      Specified by:
      remove in class HttpHeaders
      See Also:
      • HttpHeaders.remove(CharSequence)
    • remove

      public HttpHeaders remove(CharSequence name)
      Description copied from class: HttpHeaders
      Removes the header with the specified name.
      Overrides:
      remove in class HttpHeaders
      Parameters:
      name - The name of the header to remove
      Returns:
      this
    • set

      public HttpHeaders set(String name, Object value)
      Specified by:
      set in class HttpHeaders
      See Also:
      • HttpHeaders.set(CharSequence, Object)
    • set

      public HttpHeaders set(CharSequence name, Object value)
      Description copied from class: HttpHeaders
      Sets a header with the specified name and value. If there is an existing header with the same name, it is removed. If the specified value is not a String, it is converted into a String by Object.toString(), except for Date and Calendar, which are formatted to the date format defined in RFC2616.
      Overrides:
      set in class HttpHeaders
      Parameters:
      name - The name of the header being set
      value - The value of the header being set
      Returns:
      this
    • set

      public HttpHeaders set(String name, Iterable<?> values)
      Specified by:
      set in class HttpHeaders
      See Also:
      • HttpHeaders.set(CharSequence, Iterable)
    • set

      public HttpHeaders set(CharSequence name, Iterable<?> values)
      Description copied from class: HttpHeaders
      Sets a header with the specified name and values. If there is an existing header with the same name, it is removed. This getMethod can be represented approximately as the following code:
      headers.remove(name);
      for (Object v: values) {
          if (v == null) {
              break;
          }
          headers.add(name, v);
      }
      
      Overrides:
      set in class HttpHeaders
      Parameters:
      name - The name of the headers being set
      values - The values of the headers being set
      Returns:
      this
    • setInt

      public HttpHeaders setInt(CharSequence name, int value)
      Description copied from class: HttpHeaders
      Set the name to value. This will remove all previous values associated with name.
      Specified by:
      setInt in class HttpHeaders
      Parameters:
      name - The name to modify
      value - The value
      Returns:
      this
    • setShort

      public HttpHeaders setShort(CharSequence name, short value)
      Description copied from class: HttpHeaders
      Set the name to value. This will remove all previous values associated with name.
      Specified by:
      setShort in class HttpHeaders
      Parameters:
      name - The name to modify
      value - The value
      Returns:
      this
    • clear

      public HttpHeaders clear()
      Description copied from class: HttpHeaders
      Removes all headers from this HttpMessage.
      Specified by:
      clear in class HttpHeaders
      Returns:
      this
    • get

      public String get(String name)
      Specified by:
      get in class HttpHeaders
      See Also:
      • HttpHeaders.get(CharSequence)
    • get

      public String get(CharSequence name)
      Description copied from class: HttpHeaders
      Returns the value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.
      Overrides:
      get in class HttpHeaders
      Parameters:
      name - The name of the header to search
      Returns:
      The first header value or null if there is no such header
      See Also:
      • HttpHeaders.getAsString(CharSequence)
    • getInt

      public Integer getInt(CharSequence name)
      Description copied from class: HttpHeaders
      Returns the integer value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.
      Specified by:
      getInt in class HttpHeaders
      Parameters:
      name - the name of the header to search
      Returns:
      the first header value if the header is found and its value is an integer. null if there's no such header or its value is not an integer.
    • getInt

      public int getInt(CharSequence name, int defaultValue)
      Description copied from class: HttpHeaders
      Returns the integer value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.
      Specified by:
      getInt in class HttpHeaders
      Parameters:
      name - the name of the header to search
      defaultValue - the default value
      Returns:
      the first header value if the header is found and its value is an integer. defaultValue if there's no such header or its value is not an integer.
    • getShort

      public Short getShort(CharSequence name)
      Description copied from class: HttpHeaders
      Returns the short value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.
      Specified by:
      getShort in class HttpHeaders
      Parameters:
      name - the name of the header to search
      Returns:
      the first header value if the header is found and its value is a short. null if there's no such header or its value is not a short.
    • getShort

      public short getShort(CharSequence name, short defaultValue)
      Description copied from class: HttpHeaders
      Returns the short value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.
      Specified by:
      getShort in class HttpHeaders
      Parameters:
      name - the name of the header to search
      defaultValue - the default value
      Returns:
      the first header value if the header is found and its value is a short. defaultValue if there's no such header or its value is not a short.
    • getTimeMillis

      public Long getTimeMillis(CharSequence name)
      Description copied from class: HttpHeaders
      Returns the date value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.
      Specified by:
      getTimeMillis in class HttpHeaders
      Parameters:
      name - the name of the header to search
      Returns:
      the first header value if the header is found and its value is a date. null if there's no such header or its value is not a date.
    • getTimeMillis

      public long getTimeMillis(CharSequence name, long defaultValue)
      Description copied from class: HttpHeaders
      Returns the date value of a header with the specified name. If there are more than one values for the specified name, the first value is returned.
      Specified by:
      getTimeMillis in class HttpHeaders
      Parameters:
      name - the name of the header to search
      defaultValue - the default value
      Returns:
      the first header value if the header is found and its value is a date. defaultValue if there's no such header or its value is not a date.
    • getAll

      public List<String> getAll(String name)
      Specified by:
      getAll in class HttpHeaders
      See Also:
      • HttpHeaders.getAll(CharSequence)
    • getAll

      public List<String> getAll(CharSequence name)
      Description copied from class: HttpHeaders
      Returns the values of headers with the specified name
      Overrides:
      getAll in class HttpHeaders
      Parameters:
      name - The name of the headers to search
      Returns:
      A List of header values which will be empty if no values are found
      See Also:
      • HttpHeaders.getAllAsString(CharSequence)
    • entries

      public List<Map.Entry<String,String>> entries()
      Description copied from class: HttpHeaders
      Returns a new 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.
      Specified by:
      entries in class HttpHeaders
      See Also:
      • HttpHeaders.iteratorCharSequence()
    • iterator

      @Deprecated public Iterator<Map.Entry<String,String>> iterator()
      Deprecated.
      Specified by:
      iterator in interface Iterable<Map.Entry<String,String>>
      Specified by:
      iterator in class HttpHeaders
    • iteratorCharSequence

      public Iterator<Map.Entry<CharSequence, CharSequence>> iteratorCharSequence()
      Specified by:
      iteratorCharSequence in class HttpHeaders
      Returns:
      Iterator over the name/value header pairs.
    • valueStringIterator

      public Iterator<String> valueStringIterator(CharSequence name)
      Description copied from class: HttpHeaders
      Equivalent to HttpHeaders.getAll(String) but it is possible that no intermediate list is generated.
      Overrides:
      valueStringIterator in class HttpHeaders
      Parameters:
      name - the name of the header to retrieve
      Returns:
      an Iterator of header values corresponding to name.
    • valueCharSequenceIterator

      public Iterator<CharSequence> valueCharSequenceIterator(CharSequence name)
      Description copied from class: HttpHeaders
      Equivalent to HttpHeaders.getAll(String) but it is possible that no intermediate list is generated.
      Overrides:
      valueCharSequenceIterator in class HttpHeaders
      Parameters:
      name - the name of the header to retrieve
      Returns:
      an Iterator of header values corresponding to name.
    • contains

      public boolean contains(String name)
      Specified by:
      contains in class HttpHeaders
      See Also:
      • HttpHeaders.contains(CharSequence)
    • contains

      public boolean contains(CharSequence name)
      Description copied from class: HttpHeaders
      Checks to see if there is a header with the specified name
      Overrides:
      contains in class HttpHeaders
      Parameters:
      name - The name of the header to search for
      Returns:
      True if at least one header is found
    • isEmpty

      public boolean isEmpty()
      Description copied from class: HttpHeaders
      Checks if no header exists.
      Specified by:
      isEmpty in class HttpHeaders
    • size

      public int size()
      Description copied from class: HttpHeaders
      Returns the number of headers in this object.
      Specified by:
      size in class HttpHeaders
    • contains

      public boolean contains(String name, String value, boolean ignoreCase)
      Overrides:
      contains in class HttpHeaders
      See Also:
      • HttpHeaders.contains(CharSequence, CharSequence, boolean)
    • contains

      public boolean contains(CharSequence name, CharSequence value, boolean ignoreCase)
      Description copied from class: HttpHeaders
      Returns true if a header with the name and value exists, false otherwise.

      If ignoreCase is true then a case insensitive compare is done on the value.

      Overrides:
      contains in class HttpHeaders
      Parameters:
      name - the name of the header to find
      value - the value of the header to find
      ignoreCase - true then a case insensitive compare is run to compare values. otherwise a case sensitive compare is run to compare values.
    • names

      public Set<String> names()
      Description copied from class: HttpHeaders
      Returns a new 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.
      Specified by:
      names in class HttpHeaders
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • copy

      public HttpHeaders copy()
      Description copied from class: HttpHeaders
      Returns a deep copy of the passed in HttpHeaders.
      Overrides:
      copy in class HttpHeaders
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.