Class ReadOnlyHttp2Headers

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

    public final class ReadOnlyHttp2Headers
    extends java.lang.Object
    implements Http2Headers
    A variant of Http2Headers which only supports read-only methods.

    Any array passed to this class may be used directly in the underlying data structures of this class. If these arrays may be modified it is the caller's responsibility to supply this class with a copy of the array.

    This may be a good alternative to DefaultHttp2Headers if your have a fixed set of headers which will not change.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Http2Headers add​(Headers<? extends java.lang.CharSequence,​? extends java.lang.CharSequence,​?> headers)
      Adds all header names and values of headers to this object.
      Http2Headers add​(java.lang.CharSequence name, java.lang.CharSequence value)
      Adds a new header with the specified name and value.
      Http2Headers add​(java.lang.CharSequence name, java.lang.CharSequence... values)
      Adds new headers with the specified name and values.
      Http2Headers add​(java.lang.CharSequence name, java.lang.Iterable<? extends java.lang.CharSequence> values)
      Adds new headers with the specified name and values.
      Http2Headers addBoolean​(java.lang.CharSequence name, boolean value)
      Adds a new header.
      Http2Headers addByte​(java.lang.CharSequence name, byte value)
      Adds a new header.
      Http2Headers addChar​(java.lang.CharSequence name, char value)
      Adds a new header.
      Http2Headers addDouble​(java.lang.CharSequence name, double value)
      Adds a new header.
      Http2Headers addFloat​(java.lang.CharSequence name, float value)
      Adds a new header.
      Http2Headers addInt​(java.lang.CharSequence name, int value)
      Adds a new header.
      Http2Headers addLong​(java.lang.CharSequence name, long value)
      Adds a new header.
      Http2Headers addObject​(java.lang.CharSequence name, java.lang.Iterable<?> values)
      Adds a new header with the specified name and values.
      Http2Headers addObject​(java.lang.CharSequence name, java.lang.Object value)
      Adds a new header.
      Http2Headers addObject​(java.lang.CharSequence name, java.lang.Object... values)
      Adds a new header with the specified name and values.
      Http2Headers addShort​(java.lang.CharSequence name, short value)
      Adds a new header.
      Http2Headers addTimeMillis​(java.lang.CharSequence name, long value)
      Adds a new header.
      java.lang.CharSequence authority()
      Gets the Http2Headers.PseudoHeaderName.AUTHORITY header or null if there is no such header
      Http2Headers authority​(java.lang.CharSequence value)
      Http2Headers clear()
      Removes all headers.
      static ReadOnlyHttp2Headers clientHeaders​(boolean validateHeaders, AsciiString method, AsciiString path, AsciiString scheme, AsciiString authority, AsciiString... otherHeaders)
      Create a new read only representation of headers used by clients.
      boolean contains​(java.lang.CharSequence name)
      Returns true if a header with the name exists, false otherwise.
      boolean contains​(java.lang.CharSequence name, java.lang.CharSequence value)
      Returns true if a header with the name and value exists, false otherwise.
      boolean contains​(java.lang.CharSequence name, java.lang.CharSequence value, boolean caseInsensitive)
      Returns true if a header with the name and value exists, false otherwise.
      boolean containsBoolean​(java.lang.CharSequence name, boolean value)
      Returns true if a header with the name and value exists.
      boolean containsByte​(java.lang.CharSequence name, byte value)
      Returns true if a header with the name and value exists.
      boolean containsChar​(java.lang.CharSequence name, char value)
      Returns true if a header with the name and value exists.
      boolean containsDouble​(java.lang.CharSequence name, double value)
      Returns true if a header with the name and value exists.
      boolean containsFloat​(java.lang.CharSequence name, float value)
      Returns true if a header with the name and value exists.
      boolean containsInt​(java.lang.CharSequence name, int value)
      Returns true if a header with the name and value exists.
      boolean containsLong​(java.lang.CharSequence name, long value)
      Returns true if a header with the name and value exists.
      boolean containsObject​(java.lang.CharSequence name, java.lang.Object value)
      Returns true if a header with the name and value exists.
      boolean containsShort​(java.lang.CharSequence name, short value)
      Returns true if a header with the name and value exists.
      boolean containsTimeMillis​(java.lang.CharSequence name, long value)
      Returns true if a header with the name and value exists.
      java.lang.CharSequence get​(java.lang.CharSequence name)
      Returns the value of a header with the specified name.
      java.lang.CharSequence get​(java.lang.CharSequence name, java.lang.CharSequence defaultValue)
      Returns the value of a header with the specified name.
      java.util.List<java.lang.CharSequence> getAll​(java.lang.CharSequence name)
      Returns all values for the header with the specified name.
      java.util.List<java.lang.CharSequence> getAllAndRemove​(java.lang.CharSequence name)
      Returns all values for the header with the specified name and removes them from this object.
      java.lang.CharSequence getAndRemove​(java.lang.CharSequence name)
      Returns the value of a header with the specified name and removes it from this object.
      java.lang.CharSequence getAndRemove​(java.lang.CharSequence name, java.lang.CharSequence defaultValue)
      Returns the value of a header with the specified name and removes it from this object.
      java.lang.Boolean getBoolean​(java.lang.CharSequence name)
      Returns the boolean value of a header with the specified name.
      boolean getBoolean​(java.lang.CharSequence name, boolean defaultValue)
      Returns the boolean value of a header with the specified name.
      java.lang.Boolean getBooleanAndRemove​(java.lang.CharSequence name)
      Returns the boolean value of a header with the specified name and removes the header from this object.
      boolean getBooleanAndRemove​(java.lang.CharSequence name, boolean defaultValue)
      Returns the boolean value of a header with the specified name and removes the header from this object.
      java.lang.Byte getByte​(java.lang.CharSequence name)
      Returns the byte value of a header with the specified name.
      byte getByte​(java.lang.CharSequence name, byte defaultValue)
      Returns the byte value of a header with the specified name.
      java.lang.Byte getByteAndRemove​(java.lang.CharSequence name)
      Returns the byte value of a header with the specified name and removes the header from this object.
      byte getByteAndRemove​(java.lang.CharSequence name, byte defaultValue)
      Returns the byte value of a header with the specified name and removes the header from this object.
      java.lang.Character getChar​(java.lang.CharSequence name)
      Returns the char value of a header with the specified name.
      char getChar​(java.lang.CharSequence name, char defaultValue)
      Returns the char value of a header with the specified name.
      java.lang.Character getCharAndRemove​(java.lang.CharSequence name)
      Returns the char value of a header with the specified name and removes the header from this object.
      char getCharAndRemove​(java.lang.CharSequence name, char defaultValue)
      Returns the char value of a header with the specified name and removes the header from this object.
      java.lang.Double getDouble​(java.lang.CharSequence name)
      Returns the double value of a header with the specified name.
      double getDouble​(java.lang.CharSequence name, double defaultValue)
      Returns the double value of a header with the specified name.
      java.lang.Double getDoubleAndRemove​(java.lang.CharSequence name)
      Returns the double value of a header with the specified name and removes the header from this object.
      double getDoubleAndRemove​(java.lang.CharSequence name, double defaultValue)
      Returns the double value of a header with the specified name and removes the header from this object.
      java.lang.Float getFloat​(java.lang.CharSequence name)
      Returns the float value of a header with the specified name.
      float getFloat​(java.lang.CharSequence name, float defaultValue)
      Returns the float value of a header with the specified name.
      java.lang.Float getFloatAndRemove​(java.lang.CharSequence name)
      Returns the float value of a header with the specified name and removes the header from this object.
      float getFloatAndRemove​(java.lang.CharSequence name, float defaultValue)
      Returns the float value of a header with the specified name and removes the header from this object.
      java.lang.Integer getInt​(java.lang.CharSequence name)
      Returns the int value of a header with the specified name.
      int getInt​(java.lang.CharSequence name, int defaultValue)
      Returns the int value of a header with the specified name.
      java.lang.Integer getIntAndRemove​(java.lang.CharSequence name)
      Returns the int value of a header with the specified name and removes the header from this object.
      int getIntAndRemove​(java.lang.CharSequence name, int defaultValue)
      Returns the int value of a header with the specified name and removes the header from this object.
      java.lang.Long getLong​(java.lang.CharSequence name)
      Returns the long value of a header with the specified name.
      long getLong​(java.lang.CharSequence name, long defaultValue)
      Returns the long value of a header with the specified name.
      java.lang.Long getLongAndRemove​(java.lang.CharSequence name)
      Returns the long value of a header with the specified name and removes the header from this object.
      long getLongAndRemove​(java.lang.CharSequence name, long defaultValue)
      Returns the long value of a header with the specified name and removes the header from this object.
      java.lang.Short getShort​(java.lang.CharSequence name)
      Returns the short value of a header with the specified name.
      short getShort​(java.lang.CharSequence name, short defaultValue)
      Returns the short value of a header with the specified name.
      java.lang.Short getShortAndRemove​(java.lang.CharSequence name)
      Returns the short value of a header with the specified name and removes the header from this object.
      short getShortAndRemove​(java.lang.CharSequence name, short defaultValue)
      Returns the short value of a header with the specified name and removes the header from this object.
      java.lang.Long getTimeMillis​(java.lang.CharSequence name)
      Returns the value of a header with the specified name in milliseconds.
      long getTimeMillis​(java.lang.CharSequence name, long defaultValue)
      Returns the value of a header with the specified name in milliseconds.
      java.lang.Long getTimeMillisAndRemove​(java.lang.CharSequence name)
      Returns the value of a header with the specified name in milliseconds and removes the header from this object.
      long getTimeMillisAndRemove​(java.lang.CharSequence name, long defaultValue)
      Returns the value of a header with the specified name in milliseconds and removes the header from this object.
      boolean isEmpty()
      Returns true if Headers.size() equals 0.
      java.util.Iterator<java.util.Map.Entry<java.lang.CharSequence,​java.lang.CharSequence>> iterator()
      Returns an iterator over all HTTP/2 headers.
      java.lang.CharSequence method()
      Gets the Http2Headers.PseudoHeaderName.METHOD header or null if there is no such header
      Http2Headers method​(java.lang.CharSequence value)
      java.util.Set<java.lang.CharSequence> names()
      Returns a Set of all header names in this object.
      java.lang.CharSequence path()
      Gets the Http2Headers.PseudoHeaderName.PATH header or null if there is no such header
      Http2Headers path​(java.lang.CharSequence value)
      boolean remove​(java.lang.CharSequence name)
      Removes all headers with the specified name.
      java.lang.CharSequence scheme()
      Gets the Http2Headers.PseudoHeaderName.SCHEME header or null if there is no such header
      Http2Headers scheme​(java.lang.CharSequence value)
      static ReadOnlyHttp2Headers serverHeaders​(boolean validateHeaders, AsciiString status, AsciiString... otherHeaders)
      Create a new read only representation of headers used by servers.
      Http2Headers set​(Headers<? extends java.lang.CharSequence,​? extends java.lang.CharSequence,​?> headers)
      Clears the current header entries and copies all header entries of the specified headers.
      Http2Headers set​(java.lang.CharSequence name, java.lang.CharSequence value)
      Sets a header with the specified name and value.
      Http2Headers set​(java.lang.CharSequence name, java.lang.CharSequence... values)
      Sets a header with the specified name and values.
      Http2Headers set​(java.lang.CharSequence name, java.lang.Iterable<? extends java.lang.CharSequence> values)
      Sets a new header with the specified name and values.
      Http2Headers setAll​(Headers<? extends java.lang.CharSequence,​? extends java.lang.CharSequence,​?> headers)
      Retains all current headers but calls #set(K, V) for each entry in headers.
      Http2Headers setBoolean​(java.lang.CharSequence name, boolean value)
      Set the name to value.
      Http2Headers setByte​(java.lang.CharSequence name, byte value)
      Set the name to value.
      Http2Headers setChar​(java.lang.CharSequence name, char value)
      Set the name to value.
      Http2Headers setDouble​(java.lang.CharSequence name, double value)
      Set the name to value.
      Http2Headers setFloat​(java.lang.CharSequence name, float value)
      Set the name to value.
      Http2Headers setInt​(java.lang.CharSequence name, int value)
      Set the name to value.
      Http2Headers setLong​(java.lang.CharSequence name, long value)
      Set the name to value.
      Http2Headers setObject​(java.lang.CharSequence name, java.lang.Iterable<?> values)
      Sets a header with the specified name and values.
      Http2Headers setObject​(java.lang.CharSequence name, java.lang.Object value)
      Sets a new header.
      Http2Headers setObject​(java.lang.CharSequence name, java.lang.Object... values)
      Sets a header with the specified name and values.
      Http2Headers setShort​(java.lang.CharSequence name, short value)
      Set the name to value.
      Http2Headers setTimeMillis​(java.lang.CharSequence name, long value)
      Set the name to value.
      int size()
      Returns the number of headers in this object.
      java.lang.CharSequence status()
      Gets the Http2Headers.PseudoHeaderName.STATUS header or null if there is no such header
      Http2Headers status​(java.lang.CharSequence value)
      java.lang.String toString()  
      static ReadOnlyHttp2Headers trailers​(boolean validateHeaders, AsciiString... otherHeaders)
      Used to create read only object designed to represent trailers.
      java.util.Iterator<java.lang.CharSequence> valueIterator​(java.lang.CharSequence name)
      Equivalent to Headers.getAll(Object) but no intermediate list is generated.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • trailers

        public static ReadOnlyHttp2Headers trailers​(boolean validateHeaders,
                                                    AsciiString... otherHeaders)
        Used to create read only object designed to represent trailers.

        If this is used for a purpose other than trailers you may violate the header serialization ordering defined by RFC 7540, 8.1.2.1.

        Parameters:
        validateHeaders - true will run validation on each header name/value pair to ensure protocol compliance.
        otherHeaders - An array of key:value pairs. Must not contain any pseudo headers or null names/values. A copy will NOT be made of this array. If the contents of this array may be modified externally you are responsible for passing in a copy.
        Returns:
        A read only representation of the headers.
      • serverHeaders

        public static ReadOnlyHttp2Headers serverHeaders​(boolean validateHeaders,
                                                         AsciiString status,
                                                         AsciiString... otherHeaders)
        Create a new read only representation of headers used by servers.
        Parameters:
        validateHeaders - true will run validation on each header name/value pair to ensure protocol compliance.
        status - The value for Http2Headers.PseudoHeaderName.STATUS.
        otherHeaders - An array of key:value pairs. Must not contain any pseudo headers or null names/values. A copy will NOT be made of this array. If the contents of this array may be modified externally you are responsible for passing in a copy.
        Returns:
        a new read only representation of headers used by servers.
      • get

        public java.lang.CharSequence get​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        get in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the first header value if the header is found. null if there's no such header
      • get

        public java.lang.CharSequence get​(java.lang.CharSequence name,
                                          java.lang.CharSequence defaultValue)
        Description copied from interface: Headers
        Returns the value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        get in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the first header value or defaultValue if there is no such header
      • getAndRemove

        public java.lang.CharSequence getAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the value of a header with the specified name and removes it from this object. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the first header value or null if there is no such header
      • getAndRemove

        public java.lang.CharSequence getAndRemove​(java.lang.CharSequence name,
                                                   java.lang.CharSequence defaultValue)
        Description copied from interface: Headers
        Returns the value of a header with the specified name and removes it from this object. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the first header value or defaultValue if there is no such header
      • getAll

        public java.util.List<java.lang.CharSequence> getAll​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns all values for the header with the specified name. The returned List can't be modified.
        Specified by:
        getAll in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        a List of header values or an empty List if no values are found.
      • getAllAndRemove

        public java.util.List<java.lang.CharSequence> getAllAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns all values for the header with the specified name and removes them from this object. The returned List can't be modified.
        Specified by:
        getAllAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        a List of header values or an empty List if no values are found.
      • getBoolean

        public java.lang.Boolean getBoolean​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the boolean value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getBoolean in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the boolean value of the first value in insertion order or null if there is no such value or it can't be converted to boolean.
      • getBoolean

        public boolean getBoolean​(java.lang.CharSequence name,
                                  boolean defaultValue)
        Description copied from interface: Headers
        Returns the boolean value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getBoolean in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the boolean value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to boolean.
      • getByte

        public java.lang.Byte getByte​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the byte value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getByte in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the byte value of the first value in insertion order or null if there is no such value or it can't be converted to byte.
      • getByte

        public byte getByte​(java.lang.CharSequence name,
                            byte defaultValue)
        Description copied from interface: Headers
        Returns the byte value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getByte in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the byte value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to byte.
      • getChar

        public java.lang.Character getChar​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the char value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getChar in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the char value of the first value in insertion order or null if there is no such value or it can't be converted to char.
      • getChar

        public char getChar​(java.lang.CharSequence name,
                            char defaultValue)
        Description copied from interface: Headers
        Returns the char value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getChar in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the char value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to char.
      • getShort

        public java.lang.Short getShort​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the short value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getShort in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the short value of the first value in insertion order or null if there is no such value or it can't be converted to short.
      • getShort

        public short getShort​(java.lang.CharSequence name,
                              short defaultValue)
        Description copied from interface: Headers
        Returns the short value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getShort in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the short value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to short.
      • getInt

        public java.lang.Integer getInt​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the int value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getInt in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the int value of the first value in insertion order or null if there is no such value or it can't be converted to int.
      • getInt

        public int getInt​(java.lang.CharSequence name,
                          int defaultValue)
        Description copied from interface: Headers
        Returns the int value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getInt in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the int value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to int.
      • getLong

        public java.lang.Long getLong​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the long value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getLong in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the long value of the first value in insertion order or null if there is no such value or it can't be converted to long.
      • getLong

        public long getLong​(java.lang.CharSequence name,
                            long defaultValue)
        Description copied from interface: Headers
        Returns the long value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getLong in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the long value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to long.
      • getFloat

        public java.lang.Float getFloat​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the float value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getFloat in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the float value of the first value in insertion order or null if there is no such value or it can't be converted to float.
      • getFloat

        public float getFloat​(java.lang.CharSequence name,
                              float defaultValue)
        Description copied from interface: Headers
        Returns the float value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getFloat in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the float value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to float.
      • getDouble

        public java.lang.Double getDouble​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the double value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getDouble in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the double value of the first value in insertion order or null if there is no such value or it can't be converted to double.
      • getDouble

        public double getDouble​(java.lang.CharSequence name,
                                double defaultValue)
        Description copied from interface: Headers
        Returns the double value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getDouble in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the double value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to double.
      • getTimeMillis

        public java.lang.Long getTimeMillis​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the value of a header with the specified name in milliseconds. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getTimeMillis in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the milliseconds value of the first value in insertion order or null if there is no such value or it can't be converted to milliseconds.
      • getTimeMillis

        public long getTimeMillis​(java.lang.CharSequence name,
                                  long defaultValue)
        Description copied from interface: Headers
        Returns the value of a header with the specified name in milliseconds. If there is more than one value for the specified name, the first value in insertion order is returned.
        Specified by:
        getTimeMillis in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the milliseconds value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to milliseconds.
      • getBooleanAndRemove

        public java.lang.Boolean getBooleanAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the boolean value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getBooleanAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the boolean value of the first value in insertion order or null if there is no such value or it can't be converted to boolean.
      • getBooleanAndRemove

        public boolean getBooleanAndRemove​(java.lang.CharSequence name,
                                           boolean defaultValue)
        Description copied from interface: Headers
        Returns the boolean value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getBooleanAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        defaultValue - the default value
        Returns:
        the boolean value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to boolean.
      • getByteAndRemove

        public java.lang.Byte getByteAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the byte value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getByteAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        Returns:
        the byte value of the first value in insertion order or null if there is no such value or it can't be converted to byte.
      • getByteAndRemove

        public byte getByteAndRemove​(java.lang.CharSequence name,
                                     byte defaultValue)
        Description copied from interface: Headers
        Returns the byte value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getByteAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        defaultValue - the default value
        Returns:
        the byte value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to byte.
      • getCharAndRemove

        public java.lang.Character getCharAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the char value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getCharAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        Returns:
        the char value of the first value in insertion order or null if there is no such value or it can't be converted to char.
      • getCharAndRemove

        public char getCharAndRemove​(java.lang.CharSequence name,
                                     char defaultValue)
        Description copied from interface: Headers
        Returns the char value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getCharAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        defaultValue - the default value
        Returns:
        the char value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to char.
      • getShortAndRemove

        public java.lang.Short getShortAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the short value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getShortAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        Returns:
        the short value of the first value in insertion order or null if there is no such value or it can't be converted to short.
      • getShortAndRemove

        public short getShortAndRemove​(java.lang.CharSequence name,
                                       short defaultValue)
        Description copied from interface: Headers
        Returns the short value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getShortAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        defaultValue - the default value
        Returns:
        the short value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to short.
      • getIntAndRemove

        public java.lang.Integer getIntAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the int value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getIntAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        Returns:
        the int value of the first value in insertion order or null if there is no such value or it can't be converted to int.
      • getIntAndRemove

        public int getIntAndRemove​(java.lang.CharSequence name,
                                   int defaultValue)
        Description copied from interface: Headers
        Returns the int value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getIntAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        defaultValue - the default value
        Returns:
        the int value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to int.
      • getLongAndRemove

        public java.lang.Long getLongAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the long value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getLongAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        Returns:
        the long value of the first value in insertion order or null if there is no such value or it can't be converted to long.
      • getLongAndRemove

        public long getLongAndRemove​(java.lang.CharSequence name,
                                     long defaultValue)
        Description copied from interface: Headers
        Returns the long value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getLongAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        defaultValue - the default value
        Returns:
        the long value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to long.
      • getFloatAndRemove

        public java.lang.Float getFloatAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the float value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getFloatAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        Returns:
        the float value of the first value in insertion order or null if there is no such value or it can't be converted to float.
      • getFloatAndRemove

        public float getFloatAndRemove​(java.lang.CharSequence name,
                                       float defaultValue)
        Description copied from interface: Headers
        Returns the float value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getFloatAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        defaultValue - the default value
        Returns:
        the float value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to float.
      • getDoubleAndRemove

        public java.lang.Double getDoubleAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the double value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getDoubleAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        Returns:
        the double value of the first value in insertion order or null if there is no such value or it can't be converted to double.
      • getDoubleAndRemove

        public double getDoubleAndRemove​(java.lang.CharSequence name,
                                         double defaultValue)
        Description copied from interface: Headers
        Returns the double value of a header with the specified name and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getDoubleAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to search
        defaultValue - the default value
        Returns:
        the double value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to double.
      • getTimeMillisAndRemove

        public java.lang.Long getTimeMillisAndRemove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns the value of a header with the specified name in milliseconds and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getTimeMillisAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        Returns:
        the milliseconds value of the first value in insertion order or null if there is no such value or it can't be converted to milliseconds.
      • getTimeMillisAndRemove

        public long getTimeMillisAndRemove​(java.lang.CharSequence name,
                                           long defaultValue)
        Description copied from interface: Headers
        Returns the value of a header with the specified name in milliseconds and removes the header from this object. If there is more than one value for the specified name, the first value in insertion order is returned. In any case all values for name are removed.

        If an exception occurs during the translation from type T all entries with name may still be removed.

        Specified by:
        getTimeMillisAndRemove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header to retrieve
        defaultValue - the default value
        Returns:
        the milliseconds value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to milliseconds.
      • contains

        public boolean contains​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Returns true if a header with the name exists, false otherwise.
        Specified by:
        contains in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
      • contains

        public boolean contains​(java.lang.CharSequence name,
                                java.lang.CharSequence value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists, false otherwise.

        The Object.equals(Object) method is used to test for equality of value.

        Specified by:
        contains in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value of the header to find
      • containsObject

        public boolean containsObject​(java.lang.CharSequence name,
                                      java.lang.Object value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsObject in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • containsBoolean

        public boolean containsBoolean​(java.lang.CharSequence name,
                                       boolean value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsBoolean in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • containsByte

        public boolean containsByte​(java.lang.CharSequence name,
                                    byte value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsByte in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • containsChar

        public boolean containsChar​(java.lang.CharSequence name,
                                    char value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsChar in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • containsShort

        public boolean containsShort​(java.lang.CharSequence name,
                                     short value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsShort in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • containsInt

        public boolean containsInt​(java.lang.CharSequence name,
                                   int value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsInt in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • containsLong

        public boolean containsLong​(java.lang.CharSequence name,
                                    long value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsLong in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • containsFloat

        public boolean containsFloat​(java.lang.CharSequence name,
                                     float value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsFloat in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • containsDouble

        public boolean containsDouble​(java.lang.CharSequence name,
                                      double value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsDouble in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • containsTimeMillis

        public boolean containsTimeMillis​(java.lang.CharSequence name,
                                          long value)
        Description copied from interface: Headers
        Returns true if a header with the name and value exists.
        Specified by:
        containsTimeMillis in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the header value
        Returns:
        true if it contains it false otherwise
      • size

        public int size()
        Description copied from interface: Headers
        Returns the number of headers in this object.
        Specified by:
        size in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
      • names

        public java.util.Set<java.lang.CharSequence> names()
        Description copied from interface: Headers
        Returns a Set of all header names in this object. The returned Set cannot be modified.
        Specified by:
        names in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
      • add

        public Http2Headers add​(java.lang.CharSequence name,
                                java.lang.CharSequence value)
        Description copied from interface: Headers
        Adds a new header with the specified name and value.
        Specified by:
        add in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the name of the header
        value - the value of the header
        Returns:
        this
      • add

        public Http2Headers add​(java.lang.CharSequence name,
                                java.lang.Iterable<? extends java.lang.CharSequence> values)
        Description copied from interface: Headers
        Adds new headers with the specified name and values. This method is semantically equivalent to
         for (T value : values) {
             headers.add(name, value);
         }
         
        Specified by:
        add in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        values - the values of the header
        Returns:
        this
      • add

        public Http2Headers add​(java.lang.CharSequence name,
                                java.lang.CharSequence... values)
        Description copied from interface: Headers
        Adds new headers with the specified name and values. This method is semantically equivalent to
         for (T value : values) {
             headers.add(name, value);
         }
         
        Specified by:
        add in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        values - the values of the header
        Returns:
        this
      • addObject

        public Http2Headers addObject​(java.lang.CharSequence name,
                                      java.lang.Object value)
        Description copied from interface: Headers
        Adds a new header. Before the value is added, it's converted to type T.
        Specified by:
        addObject in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • addObject

        public Http2Headers addObject​(java.lang.CharSequence name,
                                      java.lang.Iterable<?> values)
        Description copied from interface: Headers
        Adds a new header with the specified name and values. This method is equivalent to
         for (Object v : values) {
             headers.addObject(name, v);
         }
         
        Specified by:
        addObject in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        values - the value of the header
        Returns:
        this
      • addObject

        public Http2Headers addObject​(java.lang.CharSequence name,
                                      java.lang.Object... values)
        Description copied from interface: Headers
        Adds a new header with the specified name and values. This method is equivalent to
         for (Object v : values) {
             headers.addObject(name, v);
         }
         
        Specified by:
        addObject in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        values - the value of the header
        Returns:
        this
      • addBoolean

        public Http2Headers addBoolean​(java.lang.CharSequence name,
                                       boolean value)
        Description copied from interface: Headers
        Adds a new header.
        Specified by:
        addBoolean in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • addByte

        public Http2Headers addByte​(java.lang.CharSequence name,
                                    byte value)
        Description copied from interface: Headers
        Adds a new header.
        Specified by:
        addByte in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • addChar

        public Http2Headers addChar​(java.lang.CharSequence name,
                                    char value)
        Description copied from interface: Headers
        Adds a new header.
        Specified by:
        addChar in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • addShort

        public Http2Headers addShort​(java.lang.CharSequence name,
                                     short value)
        Description copied from interface: Headers
        Adds a new header.
        Specified by:
        addShort in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • addInt

        public Http2Headers addInt​(java.lang.CharSequence name,
                                   int value)
        Description copied from interface: Headers
        Adds a new header.
        Specified by:
        addInt in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • addLong

        public Http2Headers addLong​(java.lang.CharSequence name,
                                    long value)
        Description copied from interface: Headers
        Adds a new header.
        Specified by:
        addLong in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • addFloat

        public Http2Headers addFloat​(java.lang.CharSequence name,
                                     float value)
        Description copied from interface: Headers
        Adds a new header.
        Specified by:
        addFloat in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • addDouble

        public Http2Headers addDouble​(java.lang.CharSequence name,
                                      double value)
        Description copied from interface: Headers
        Adds a new header.
        Specified by:
        addDouble in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • addTimeMillis

        public Http2Headers addTimeMillis​(java.lang.CharSequence name,
                                          long value)
        Description copied from interface: Headers
        Adds a new header.
        Specified by:
        addTimeMillis in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • add

        public Http2Headers add​(Headers<? extends java.lang.CharSequence,​? extends java.lang.CharSequence,​?> headers)
        Description copied from interface: Headers
        Adds all header names and values of headers to this object.
        Specified by:
        add in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Returns:
        this
      • set

        public Http2Headers set​(java.lang.CharSequence name,
                                java.lang.CharSequence value)
        Description copied from interface: Headers
        Sets a header with the specified name and value. Any existing headers with the same name are overwritten.
        Specified by:
        set in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • set

        public Http2Headers set​(java.lang.CharSequence name,
                                java.lang.Iterable<? extends java.lang.CharSequence> values)
        Description copied from interface: Headers
        Sets a new header with the specified name and values. This method is equivalent to
         for (T v : values) {
             headers.addObject(name, v);
         }
         
        Specified by:
        set in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        values - the value of the header
        Returns:
        this
      • set

        public Http2Headers set​(java.lang.CharSequence name,
                                java.lang.CharSequence... values)
        Description copied from interface: Headers
        Sets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:
         headers.remove(name);
         for (T v : values) {
             headers.add(name, v);
         }
         
        Specified by:
        set in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        values - the value of the header
        Returns:
        this
      • setObject

        public Http2Headers setObject​(java.lang.CharSequence name,
                                      java.lang.Object value)
        Description copied from interface: Headers
        Sets a new header. Any existing headers with this name are removed. Before the value is add, it's converted to type T.
        Specified by:
        setObject in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        value - the value of the header
        Returns:
        this
      • setObject

        public Http2Headers setObject​(java.lang.CharSequence name,
                                      java.lang.Iterable<?> values)
        Description copied from interface: Headers
        Sets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:
         headers.remove(name);
         for (Object v : values) {
             headers.addObject(name, v);
         }
         
        Specified by:
        setObject in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        values - the values of the header
        Returns:
        this
      • setObject

        public Http2Headers setObject​(java.lang.CharSequence name,
                                      java.lang.Object... values)
        Description copied from interface: Headers
        Sets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:
         headers.remove(name);
         for (Object v : values) {
             headers.addObject(name, v);
         }
         
        Specified by:
        setObject in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        values - the values of the header
        Returns:
        this
      • setBoolean

        public Http2Headers setBoolean​(java.lang.CharSequence name,
                                       boolean value)
        Description copied from interface: Headers
        Set the name to value. This will remove all previous values associated with name.
        Specified by:
        setBoolean in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - The name to modify
        value - The value
        Returns:
        this
      • setByte

        public Http2Headers setByte​(java.lang.CharSequence name,
                                    byte value)
        Description copied from interface: Headers
        Set the name to value. This will remove all previous values associated with name.
        Specified by:
        setByte in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - The name to modify
        value - The value
        Returns:
        this
      • setChar

        public Http2Headers setChar​(java.lang.CharSequence name,
                                    char value)
        Description copied from interface: Headers
        Set the name to value. This will remove all previous values associated with name.
        Specified by:
        setChar in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - The name to modify
        value - The value
        Returns:
        this
      • setShort

        public Http2Headers setShort​(java.lang.CharSequence name,
                                     short value)
        Description copied from interface: Headers
        Set the name to value. This will remove all previous values associated with name.
        Specified by:
        setShort in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - The name to modify
        value - The value
        Returns:
        this
      • setInt

        public Http2Headers setInt​(java.lang.CharSequence name,
                                   int value)
        Description copied from interface: Headers
        Set the name to value. This will remove all previous values associated with name.
        Specified by:
        setInt in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - The name to modify
        value - The value
        Returns:
        this
      • setLong

        public Http2Headers setLong​(java.lang.CharSequence name,
                                    long value)
        Description copied from interface: Headers
        Set the name to value. This will remove all previous values associated with name.
        Specified by:
        setLong in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - The name to modify
        value - The value
        Returns:
        this
      • setFloat

        public Http2Headers setFloat​(java.lang.CharSequence name,
                                     float value)
        Description copied from interface: Headers
        Set the name to value. This will remove all previous values associated with name.
        Specified by:
        setFloat in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - The name to modify
        value - The value
        Returns:
        this
      • setDouble

        public Http2Headers setDouble​(java.lang.CharSequence name,
                                      double value)
        Description copied from interface: Headers
        Set the name to value. This will remove all previous values associated with name.
        Specified by:
        setDouble in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - The name to modify
        value - The value
        Returns:
        this
      • setTimeMillis

        public Http2Headers setTimeMillis​(java.lang.CharSequence name,
                                          long value)
        Description copied from interface: Headers
        Set the name to value. This will remove all previous values associated with name.
        Specified by:
        setTimeMillis in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - The name to modify
        value - The value
        Returns:
        this
      • set

        public Http2Headers set​(Headers<? extends java.lang.CharSequence,​? extends java.lang.CharSequence,​?> headers)
        Description copied from interface: Headers
        Clears the current header entries and copies all header entries of the specified headers.
        Specified by:
        set in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Returns:
        this
      • setAll

        public Http2Headers setAll​(Headers<? extends java.lang.CharSequence,​? extends java.lang.CharSequence,​?> headers)
        Description copied from interface: Headers
        Retains all current headers but calls #set(K, V) for each entry in headers.
        Specified by:
        setAll in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        headers - The headers used to #set(K, V) values in this instance
        Returns:
        this
      • remove

        public boolean remove​(java.lang.CharSequence name)
        Description copied from interface: Headers
        Removes all headers with the specified name.
        Specified by:
        remove in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Parameters:
        name - the header name
        Returns:
        true if at least one entry has been removed.
      • iterator

        public java.util.Iterator<java.util.Map.Entry<java.lang.CharSequence,​java.lang.CharSequence>> iterator()
        Description copied from interface: Http2Headers
        Returns an iterator over all HTTP/2 headers. The iteration order is as follows: 1. All pseudo headers (order not specified). 2. All non-pseudo headers (in insertion order).
        Specified by:
        iterator in interface Headers<java.lang.CharSequence,​java.lang.CharSequence,​Http2Headers>
        Specified by:
        iterator in interface Http2Headers
        Specified by:
        iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.CharSequence,​java.lang.CharSequence>>
      • valueIterator

        public java.util.Iterator<java.lang.CharSequence> valueIterator​(java.lang.CharSequence name)
        Description copied from interface: Http2Headers
        Equivalent to Headers.getAll(Object) but no intermediate list is generated.
        Specified by:
        valueIterator in interface Http2Headers
        Parameters:
        name - the name of the header to retrieve
        Returns:
        an Iterator of header values corresponding to name.
      • contains

        public boolean contains​(java.lang.CharSequence name,
                                java.lang.CharSequence value,
                                boolean caseInsensitive)
        Description copied from interface: Http2Headers
        Returns true if a header with the name and value exists, false otherwise.

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

        Specified by:
        contains in interface Http2Headers
        Parameters:
        name - the name of the header to find
        value - the value of the header to find
        caseInsensitive - true then a case insensitive compare is run to compare values. otherwise a case sensitive compare is run to compare values.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object