K - the type of the header name.V - the type of the header value.T - the type to use for return values when the intention is to return this object.public class DefaultHeaders<K,V,T extends Headers<K,V,T>> extends Object implements Headers<K,V,T>
Headers;| Modifier and Type | Class and Description | 
|---|---|
| protected static class  | DefaultHeaders.HeaderEntry<K,V> | 
| static interface  | DefaultHeaders.NameValidator<K> | 
| static interface  | DefaultHeaders.ValueValidator<V> | 
| Modifier and Type | Field and Description | 
|---|---|
| protected DefaultHeaders.HeaderEntry<K,V> | head | 
| Constructor and Description | 
|---|
| DefaultHeaders(HashingStrategy<K> nameHashingStrategy,
              ValueConverter<V> valueConverter) | 
| DefaultHeaders(HashingStrategy<K> nameHashingStrategy,
              ValueConverter<V> valueConverter,
              DefaultHeaders.NameValidator<K> nameValidator) | 
| DefaultHeaders(HashingStrategy<K> nameHashingStrategy,
              ValueConverter<V> valueConverter,
              DefaultHeaders.NameValidator<K> nameValidator,
              int arraySizeHint)Create a new instance. | 
| DefaultHeaders(HashingStrategy<K> nameHashingStrategy,
              ValueConverter<V> valueConverter,
              DefaultHeaders.NameValidator<K> nameValidator,
              int arraySizeHint,
              DefaultHeaders.ValueValidator<V> valueValidator)Create a new instance. | 
| DefaultHeaders(ValueConverter<V> valueConverter) | 
| DefaultHeaders(ValueConverter<V> valueConverter,
              DefaultHeaders.NameValidator<K> nameValidator) | 
| Modifier and Type | Method and Description | 
|---|---|
| T | add(Headers<? extends K,? extends V,?> headers)Adds all header names and values of  headersto this object. | 
| T | add(K name,
   Iterable<? extends V> values)Adds new headers with the specified  nameandvalues. | 
| T | add(K name,
   V... values)Adds new headers with the specified  nameandvalues. | 
| T | add(K name,
   V value)Adds a new header with the specified  nameandvalue. | 
| T | addBoolean(K name,
          boolean value)Adds a new header. | 
| T | addByte(K name,
       byte value)Adds a new header. | 
| T | addChar(K name,
       char value)Adds a new header. | 
| T | addDouble(K name,
         double value)Adds a new header. | 
| T | addFloat(K name,
        float value)Adds a new header. | 
| protected void | addImpl(Headers<? extends K,? extends V,?> headers) | 
| T | addInt(K name,
      int value)Adds a new header. | 
| T | addLong(K name,
       long value)Adds a new header. | 
| T | addObject(K name,
         Iterable<?> values)Adds a new header with the specified name and values. | 
| T | addObject(K name,
         Object... values)Adds a new header with the specified name and values. | 
| T | addObject(K name,
         Object value)Adds a new header. | 
| T | addShort(K name,
        short value)Adds a new header. | 
| T | addTimeMillis(K name,
             long value)Adds a new header. | 
| T | clear()Removes all headers. | 
| boolean | contains(K name)Returns  trueif a header with thenameexists,falseotherwise. | 
| boolean | contains(K name,
        V value)Returns  trueif a header with thenameandvalueexists,falseotherwise. | 
| boolean | contains(K name,
        V value,
        HashingStrategy<? super V> valueHashingStrategy) | 
| boolean | containsBoolean(K name,
               boolean value)Returns  trueif a header with the name and value exists. | 
| boolean | containsByte(K name,
            byte value)Returns  trueif a header with the name and value exists. | 
| boolean | containsChar(K name,
            char value)Returns  trueif a header with the name and value exists. | 
| boolean | containsDouble(K name,
              double value)Returns  trueif a header with the name and value exists. | 
| boolean | containsFloat(K name,
             float value)Returns  trueif a header with the name and value exists. | 
| boolean | containsInt(K name,
           int value)Returns  trueif a header with the name and value exists. | 
| boolean | containsLong(K name,
            long value)Returns  trueif a header with the name and value exists. | 
| boolean | containsObject(K name,
              Object value)Returns  trueif a header with the name and value exists. | 
| boolean | containsShort(K name,
             short value)Returns  trueif a header with the name and value exists. | 
| boolean | containsTimeMillis(K name,
                  long value)Returns  trueif a header with the name and value exists. | 
| DefaultHeaders<K,V,T> | copy()Returns a deep copy of this instance. | 
| boolean | equals(Headers<K,V,?> h2,
      HashingStrategy<V> valueHashingStrategy)Test this object for equality against  h2. | 
| boolean | equals(Object o) | 
| V | get(K name)Returns the value of a header with the specified name. | 
| V | get(K name,
   V defaultValue)Returns the value of a header with the specified name. | 
| List<V> | getAll(K name)Returns all values for the header with the specified name. | 
| List<V> | getAllAndRemove(K name)Returns all values for the header with the specified name and removes them from this object. | 
| V | getAndRemove(K name)Returns the value of a header with the specified name and removes it from this object. | 
| V | getAndRemove(K name,
            V defaultValue)Returns the value of a header with the specified name and removes it from this object. | 
| Boolean | getBoolean(K name)Returns the  booleanvalue of a header with the specified name. | 
| boolean | getBoolean(K name,
          boolean defaultValue)Returns the  booleanvalue of a header with the specified name. | 
| Boolean | getBooleanAndRemove(K name)Returns the  booleanvalue of a header with the specifiednameand removes the header from this
 object. | 
| boolean | getBooleanAndRemove(K name,
                   boolean defaultValue)Returns the  booleanvalue of a header with the specifiednameand removes the header from this
 object. | 
| Byte | getByte(K name)Returns the  bytevalue of a header with the specified name. | 
| byte | getByte(K name,
       byte defaultValue)Returns the  bytevalue of a header with the specified name. | 
| Byte | getByteAndRemove(K name)Returns the  bytevalue of a header with the specifiednameand removes the header from this
 object. | 
| byte | getByteAndRemove(K name,
                byte defaultValue)Returns the  bytevalue of a header with the specifiednameand removes the header from this
 object. | 
| Character | getChar(K name)Returns the  charvalue of a header with the specified name. | 
| char | getChar(K name,
       char defaultValue)Returns the  charvalue of a header with the specified name. | 
| Character | getCharAndRemove(K name)Returns the  charvalue of a header with the specifiednameand removes the header from this
 object. | 
| char | getCharAndRemove(K name,
                char defaultValue)Returns the  charvalue of a header with the specifiednameand removes the header from this
 object. | 
| Double | getDouble(K name)Returns the  doublevalue of a header with the specified name. | 
| double | getDouble(K name,
         double defaultValue)Returns the  doublevalue of a header with the specified name. | 
| Double | getDoubleAndRemove(K name)Returns the  doublevalue of a header with the specifiednameand removes the header from this
 object. | 
| double | getDoubleAndRemove(K name,
                  double defaultValue)Returns the  doublevalue of a header with the specifiednameand removes the header from this
 object. | 
| Float | getFloat(K name)Returns the  floatvalue of a header with the specified name. | 
| float | getFloat(K name,
        float defaultValue)Returns the  floatvalue of a header with the specified name. | 
| Float | getFloatAndRemove(K name)Returns the  floatvalue of a header with the specifiednameand removes the header from this
 object. | 
| float | getFloatAndRemove(K name,
                 float defaultValue)Returns the  floatvalue of a header with the specifiednameand removes the header from this
 object. | 
| Integer | getInt(K name)Returns the  intvalue of a header with the specified name. | 
| int | getInt(K name,
      int defaultValue)Returns the  intvalue of a header with the specified name. | 
| Integer | getIntAndRemove(K name)Returns the  intvalue of a header with the specifiednameand removes the header from this
 object. | 
| int | getIntAndRemove(K name,
               int defaultValue)Returns the  intvalue of a header with the specifiednameand removes the header from this
 object. | 
| Long | getLong(K name)Returns the  longvalue of a header with the specified name. | 
| long | getLong(K name,
       long defaultValue)Returns the  longvalue of a header with the specified name. | 
| Long | getLongAndRemove(K name)Returns the  longvalue of a header with the specifiednameand removes the header from this
 object. | 
| long | getLongAndRemove(K name,
                long defaultValue)Returns the  longvalue of a header with the specifiednameand removes the header from this
 object. | 
| Short | getShort(K name)Returns the  shortvalue of a header with the specified name. | 
| short | getShort(K name,
        short defaultValue)Returns the  shortvalue of a header with the specified name. | 
| Short | getShortAndRemove(K name)Returns the  shortvalue of a header with the specifiednameand removes the header from this
 object. | 
| short | getShortAndRemove(K name,
                 short defaultValue)Returns the  shortvalue of a header with the specifiednameand removes the header from this
 object. | 
| Long | getTimeMillis(K name)Returns the value of a header with the specified name in milliseconds. | 
| long | getTimeMillis(K name,
             long defaultValue)Returns the value of a header with the specified name in milliseconds. | 
| Long | getTimeMillisAndRemove(K name)Returns the value of a header with the specified  namein milliseconds and removes the header from this
 object. | 
| long | getTimeMillisAndRemove(K name,
                      long defaultValue)Returns the value of a header with the specified  namein milliseconds and removes the header from this
 object. | 
| int | hashCode() | 
| int | hashCode(HashingStrategy<V> valueHashingStrategy)Generate a hash code for this object given a  HashingStrategyto generate hash codes for
 individual values. | 
| boolean | isEmpty() | 
| Iterator<Map.Entry<K,V>> | iterator() | 
| Set<K> | names()Returns a  Setof all header names in this object. | 
| protected DefaultHeaders.NameValidator<K> | nameValidator() | 
| protected DefaultHeaders.HeaderEntry<K,V> | newHeaderEntry(int h,
              K name,
              V value,
              DefaultHeaders.HeaderEntry<K,V> next) | 
| boolean | remove(K name)Removes all headers with the specified  name. | 
| T | set(Headers<? extends K,? extends V,?> headers)Clears the current header entries and copies all header entries of the specified  headers. | 
| T | set(K name,
   Iterable<? extends V> values)Sets a new header with the specified name and values. | 
| T | set(K name,
   V... values)Sets a header with the specified name and values. | 
| T | set(K name,
   V value)Sets a header with the specified name and value. | 
| T | setAll(Headers<? extends K,? extends V,?> headers)Retains all current headers but calls  #set(K, V)for each entry inheaders. | 
| T | setBoolean(K name,
          boolean value)Set the  nametovalue. | 
| T | setByte(K name,
       byte value)Set the  nametovalue. | 
| T | setChar(K name,
       char value)Set the  nametovalue. | 
| T | setDouble(K name,
         double value)Set the  nametovalue. | 
| T | setFloat(K name,
        float value)Set the  nametovalue. | 
| T | setInt(K name,
      int value)Set the  nametovalue. | 
| T | setLong(K name,
       long value)Set the  nametovalue. | 
| T | setObject(K name,
         Iterable<?> values)Sets a header with the specified name and values. | 
| T | setObject(K name,
         Object... values)Sets a header with the specified name and values. | 
| T | setObject(K name,
         Object value)Sets a new header. | 
| T | setShort(K name,
        short value)Set the  nametovalue. | 
| T | setTimeMillis(K name,
             long value)Set the  nametovalue. | 
| int | size()Returns the number of headers in this object. | 
| String | toString() | 
| protected void | validateName(DefaultHeaders.NameValidator<K> validator,
            boolean forAdd,
            K name)Call out to the given  DefaultHeaders.NameValidatorto validate the given name. | 
| protected void | validateValue(DefaultHeaders.ValueValidator<V> validator,
             K name,
             V value) | 
| protected ValueConverter<V> | valueConverter() | 
| Iterator<V> | valueIterator(K name)Equivalent to  getAll(Object)but no intermediate list is generated. | 
| protected DefaultHeaders.ValueValidator<V> | valueValidator() | 
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected final DefaultHeaders.HeaderEntry<K,V> head
public DefaultHeaders(ValueConverter<V> valueConverter)
public DefaultHeaders(ValueConverter<V> valueConverter, DefaultHeaders.NameValidator<K> nameValidator)
public DefaultHeaders(HashingStrategy<K> nameHashingStrategy, ValueConverter<V> valueConverter)
public DefaultHeaders(HashingStrategy<K> nameHashingStrategy, ValueConverter<V> valueConverter, DefaultHeaders.NameValidator<K> nameValidator)
public DefaultHeaders(HashingStrategy<K> nameHashingStrategy, ValueConverter<V> valueConverter, DefaultHeaders.NameValidator<K> nameValidator, int arraySizeHint)
nameHashingStrategy - Used to hash and equality compare names.valueConverter - Used to convert values to/from native types.nameValidator - Used to validate name elements.arraySizeHint - A hint as to how large the hash data structure should be.
 The next positive power of two will be used. An upper bound may be enforced.public DefaultHeaders(HashingStrategy<K> nameHashingStrategy, ValueConverter<V> valueConverter, DefaultHeaders.NameValidator<K> nameValidator, int arraySizeHint, DefaultHeaders.ValueValidator<V> valueValidator)
nameHashingStrategy - Used to hash and equality compare names.valueConverter - Used to convert values to/from native types.nameValidator - Used to validate name elements.arraySizeHint - A hint as to how large the hash data structure should be.
 The next positive power of two will be used. An upper bound may be enforced.valueValidator - The validation strategy for entry values.public V get(K name)
Headerspublic V get(K name, V defaultValue)
Headerspublic V getAndRemove(K name)
Headerspublic V getAndRemove(K name, V defaultValue)
Headerspublic List<V> getAll(K name)
HeadersList can't be modified.public Iterator<V> valueIterator(K name)
getAll(Object) but no intermediate list is generated.name - the name of the header to retrieveIterator of header values corresponding to name.public List<V> getAllAndRemove(K name)
HeadersList can't be modified.public boolean contains(K name)
Headerstrue if a header with the name exists, false otherwise.public boolean containsObject(K name, Object value)
Headerstrue if a header with the name and value exists.public boolean containsBoolean(K name, boolean value)
Headerstrue if a header with the name and value exists.public boolean containsByte(K name, byte value)
Headerstrue if a header with the name and value exists.public boolean containsChar(K name, char value)
Headerstrue if a header with the name and value exists.public boolean containsShort(K name, short value)
Headerstrue if a header with the name and value exists.public boolean containsInt(K name, int value)
Headerstrue if a header with the name and value exists.public boolean containsLong(K name, long value)
Headerstrue if a header with the name and value exists.public boolean containsFloat(K name, float value)
Headerstrue if a header with the name and value exists.public boolean containsDouble(K name, double value)
Headerstrue if a header with the name and value exists.public boolean containsTimeMillis(K name, long value)
Headerstrue if a header with the name and value exists.public boolean contains(K name, V value)
Headerstrue if a header with the name and value exists, false otherwise.
 
 The Object.equals(Object) method is used to test for equality of value.
 
public final boolean contains(K name, V value, HashingStrategy<? super V> valueHashingStrategy)
public int size()
Headerspublic boolean isEmpty()
Headerspublic T add(K name, V value)
Headersname and value.public T add(K name, Iterable<? extends V> values)
Headersname and values. This method is semantically equivalent to
 
 for (T value : values) {
     headers.add(name, value);
 }
 public T add(K name, V... values)
Headersname and values. This method is semantically equivalent to
 
 for (T value : values) {
     headers.add(name, value);
 }
 public T addObject(K name, Object value)
Headersvalue is added, it's converted to type T.public T addObject(K name, Iterable<?> values)
Headers
 for (Object v : values) {
     headers.addObject(name, v);
 }
 public T addObject(K name, Object... values)
Headers
 for (Object v : values) {
     headers.addObject(name, v);
 }
 public T addInt(K name, int value)
Headerspublic T addLong(K name, long value)
Headerspublic T addDouble(K name, double value)
Headerspublic T addTimeMillis(K name, long value)
Headerspublic T addChar(K name, char value)
Headerspublic T addBoolean(K name, boolean value)
Headerspublic T addFloat(K name, float value)
Headerspublic T addByte(K name, byte value)
Headerspublic T addShort(K name, short value)
Headerspublic T add(Headers<? extends K,? extends V,?> headers)
Headersheaders to this object.public T set(K name, V value)
Headerspublic T set(K name, Iterable<? extends V> values)
Headers
 for (T v : values) {
     headers.addObject(name, v);
 }
 public T set(K name, V... values)
Headers
 headers.remove(name);
 for (T v : values) {
     headers.add(name, v);
 }
 public T setObject(K name, Object value)
Headersvalue is add, it's
 converted to type T.public T setObject(K name, Iterable<?> values)
Headers
 headers.remove(name);
 for (Object v : values) {
     headers.addObject(name, v);
 }
 public T setObject(K name, Object... values)
Headers
 headers.remove(name);
 for (Object v : values) {
     headers.addObject(name, v);
 }
 public T setInt(K name, int value)
Headersname to value. This will remove all previous values associated with name.public T setLong(K name, long value)
Headersname to value. This will remove all previous values associated with name.public T setDouble(K name, double value)
Headersname to value. This will remove all previous values associated with name.public T setTimeMillis(K name, long value)
Headersname to value. This will remove all previous values associated with name.public T setFloat(K name, float value)
Headersname to value. This will remove all previous values associated with name.public T setChar(K name, char value)
Headersname to value. This will remove all previous values associated with name.public T setBoolean(K name, boolean value)
Headersname to value. This will remove all previous values associated with name.public T setByte(K name, byte value)
Headersname to value. This will remove all previous values associated with name.public T setShort(K name, short value)
Headersname to value. This will remove all previous values associated with name.public T set(Headers<? extends K,? extends V,?> headers)
Headersheaders.public T setAll(Headers<? extends K,? extends V,?> headers)
Headers#set(K, V) for each entry in headers.public boolean remove(K name)
Headersname.public T clear()
HeadersHeaders.size() equals 0.public Boolean getBoolean(K name)
Headersboolean 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.public boolean getBoolean(K name, boolean defaultValue)
Headersboolean 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.getBoolean in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to retrievedefaultValue - the default valueboolean value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to boolean.public Byte getByte(K name)
Headersbyte 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.public byte getByte(K name, byte defaultValue)
Headersbyte 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.public Character getChar(K name)
Headerschar 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.public char getChar(K name, char defaultValue)
Headerschar 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.public Short getShort(K name)
Headersshort 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.public short getShort(K name, short defaultValue)
Headersshort 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.getShort in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to retrievedefaultValue - the default valueshort value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to short.public Integer getInt(K name)
Headersint 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.public int getInt(K name, int defaultValue)
Headersint 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.public Long getLong(K name)
Headerslong 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.public long getLong(K name, long defaultValue)
Headerslong 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.public Float getFloat(K name)
Headersfloat 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.public float getFloat(K name, float defaultValue)
Headersfloat 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.getFloat in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to retrievedefaultValue - the default valuefloat value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to float.public Double getDouble(K name)
Headersdouble 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.public double getDouble(K name, double defaultValue)
Headersdouble 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.getDouble in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to retrievedefaultValue - the default valuedouble value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to double.public Long getTimeMillis(K name)
Headerspublic long getTimeMillis(K name, long defaultValue)
HeadersgetTimeMillis in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to retrievedefaultValue - the default valuedefaultValue if there is no such
         value or it can't be converted to milliseconds.public Boolean getBooleanAndRemove(K name)
Headersboolean 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.
public boolean getBooleanAndRemove(K name, boolean defaultValue)
Headersboolean 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.
getBooleanAndRemove in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to searchdefaultValue - the default valueboolean value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to boolean.public Byte getByteAndRemove(K name)
Headersbyte 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.
public byte getByteAndRemove(K name, byte defaultValue)
Headersbyte 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.
getByteAndRemove in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to searchdefaultValue - the default valuebyte value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to byte.public Character getCharAndRemove(K name)
Headerschar 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.
public char getCharAndRemove(K name, char defaultValue)
Headerschar 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.
getCharAndRemove in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to searchdefaultValue - the default valuechar value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to char.public Short getShortAndRemove(K name)
Headersshort 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.
public short getShortAndRemove(K name, short defaultValue)
Headersshort 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.
getShortAndRemove in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to searchdefaultValue - the default valueshort value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to short.public Integer getIntAndRemove(K name)
Headersint 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.
public int getIntAndRemove(K name, int defaultValue)
Headersint 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.
getIntAndRemove in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to searchdefaultValue - the default valueint value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to int.public Long getLongAndRemove(K name)
Headerslong 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.
public long getLongAndRemove(K name, long defaultValue)
Headerslong 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.
getLongAndRemove in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to searchdefaultValue - the default valuelong value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to long.public Float getFloatAndRemove(K name)
Headersfloat 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.
public float getFloatAndRemove(K name, float defaultValue)
Headersfloat 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.
getFloatAndRemove in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to searchdefaultValue - the default valuefloat value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to float.public Double getDoubleAndRemove(K name)
Headersdouble 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.
public double getDoubleAndRemove(K name, double defaultValue)
Headersdouble 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.
getDoubleAndRemove in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to searchdefaultValue - the default valuedouble value of the first value in insertion order or defaultValue if there is no
         such value or it can't be converted to double.public Long getTimeMillisAndRemove(K name)
Headersname 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.
public long getTimeMillisAndRemove(K name, long defaultValue)
Headersname 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.
getTimeMillisAndRemove in interface Headers<K,V,T extends Headers<K,V,T>>name - the name of the header to retrievedefaultValue - the default valuedefaultValue if there is no such
         value or it can't be converted to milliseconds.public final boolean equals(Headers<K,V,?> h2, HashingStrategy<V> valueHashingStrategy)
h2.h2 - The object to check equality for.valueHashingStrategy - Defines how values will be compared for equality.true if this object equals h2 given valueHashingStrategy.
 false otherwise.public final int hashCode(HashingStrategy<V> valueHashingStrategy)
HashingStrategy to generate hash codes for
 individual values.valueHashingStrategy - Defines how values will be hashed.protected void validateName(DefaultHeaders.NameValidator<K> validator, boolean forAdd, K name)
DefaultHeaders.NameValidator to validate the given name.validator - the validator to useforAdd - true  if this validation is for adding to the headers, or false if this is for
 setting (overwriting) the given header.name - the name to validate.protected void validateValue(DefaultHeaders.ValueValidator<V> validator, K name, V value)
protected DefaultHeaders.HeaderEntry<K,V> newHeaderEntry(int h, K name, V value, DefaultHeaders.HeaderEntry<K,V> next)
protected ValueConverter<V> valueConverter()
protected DefaultHeaders.NameValidator<K> nameValidator()
protected DefaultHeaders.ValueValidator<V> valueValidator()
public DefaultHeaders<K,V,T> copy()
Copyright © 2008–2025 The Netty Project. All rights reserved.