Class EmptyHttpHeaders

  • All Implemented Interfaces:
    java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.String>>

    public class EmptyHttpHeaders
    extends HttpHeaders
    • Constructor Detail

      • EmptyHttpHeaders

        protected EmptyHttpHeaders()
    • Method Detail

      • getInt

        public java.lang.Integer getInt​(java.lang.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​(java.lang.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 java.lang.Short getShort​(java.lang.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​(java.lang.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 java.lang.Long getTimeMillis​(java.lang.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​(java.lang.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.
      • entries

        public java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.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()
      • 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
      • names

        public java.util.Set<java.lang.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
      • addInt

        public HttpHeaders addInt​(java.lang.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​(java.lang.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
      • setInt

        public HttpHeaders setInt​(java.lang.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​(java.lang.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
      • iterator

        public java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.String>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.String>>
        Specified by:
        iterator in class HttpHeaders
      • iteratorCharSequence

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