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 interface Headers<K,V,T extends Headers<K,V,T>> extends Iterable<Map.Entry<K,V>>
Headers
which represents a mapping of key to value.
Duplicate keys may be allowed by implementations.Modifier and Type | Method and Description |
---|---|
T |
add(Headers<? extends K,? extends V,?> headers)
Adds all header names and values of
headers to this object. |
T |
add(K name,
Iterable<? extends V> values)
Adds new headers with the specified
name and values . |
T |
add(K name,
V... values)
Adds new headers with the specified
name and values . |
T |
add(K name,
V value)
Adds a new header with the specified
name and value . |
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.
|
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
true if a header with the name exists, false otherwise. |
boolean |
contains(K name,
V value)
Returns
true if a header with the name and value exists, false otherwise. |
boolean |
containsBoolean(K name,
boolean value)
Returns
true if a header with the name and value exists. |
boolean |
containsByte(K name,
byte value)
Returns
true if a header with the name and value exists. |
boolean |
containsChar(K name,
char value)
Returns
true if a header with the name and value exists. |
boolean |
containsDouble(K name,
double value)
Returns
true if a header with the name and value exists. |
boolean |
containsFloat(K name,
float value)
Returns
true if a header with the name and value exists. |
boolean |
containsInt(K name,
int value)
Returns
true if a header with the name and value exists. |
boolean |
containsLong(K name,
long value)
Returns
true if a header with the name and value exists. |
boolean |
containsObject(K name,
Object value)
Returns
true if a header with the name and value exists. |
boolean |
containsShort(K name,
short value)
Returns
true if a header with the name and value exists. |
boolean |
containsTimeMillis(K name,
long value)
Returns
true if a header with the name and value exists. |
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
boolean value of a header with the specified name. |
boolean |
getBoolean(K name,
boolean defaultValue)
Returns the
boolean value of a header with the specified name. |
Boolean |
getBooleanAndRemove(K name)
Returns the
boolean value of a header with the specified name and removes the header from this
object. |
boolean |
getBooleanAndRemove(K name,
boolean defaultValue)
Returns the
boolean value of a header with the specified name and removes the header from this
object. |
Byte |
getByte(K name)
Returns the
byte value of a header with the specified name. |
byte |
getByte(K name,
byte defaultValue)
Returns the
byte value of a header with the specified name. |
Byte |
getByteAndRemove(K name)
Returns the
byte value of a header with the specified name and removes the header from this
object. |
byte |
getByteAndRemove(K name,
byte defaultValue)
Returns the
byte value of a header with the specified name and removes the header from this
object. |
Character |
getChar(K name)
Returns the
char value of a header with the specified name. |
char |
getChar(K name,
char defaultValue)
Returns the
char value of a header with the specified name. |
Character |
getCharAndRemove(K name)
Returns the
char value of a header with the specified name and removes the header from this
object. |
char |
getCharAndRemove(K name,
char defaultValue)
Returns the
char value of a header with the specified name and removes the header from this
object. |
Double |
getDouble(K name)
Returns the
double value of a header with the specified name. |
double |
getDouble(K name,
double defaultValue)
Returns the
double value of a header with the specified name. |
Double |
getDoubleAndRemove(K name)
Returns the
double value of a header with the specified name and removes the header from this
object. |
double |
getDoubleAndRemove(K name,
double defaultValue)
Returns the
double value of a header with the specified name and removes the header from this
object. |
Float |
getFloat(K name)
Returns the
float value of a header with the specified name. |
float |
getFloat(K name,
float defaultValue)
Returns the
float value of a header with the specified name. |
Float |
getFloatAndRemove(K name)
Returns the
float value of a header with the specified name and removes the header from this
object. |
float |
getFloatAndRemove(K name,
float defaultValue)
Returns the
float value of a header with the specified name and removes the header from this
object. |
Integer |
getInt(K name)
Returns the
int value of a header with the specified name. |
int |
getInt(K name,
int defaultValue)
Returns the
int value of a header with the specified name. |
Integer |
getIntAndRemove(K name)
Returns the
int value of a header with the specified name and removes the header from this
object. |
int |
getIntAndRemove(K name,
int defaultValue)
Returns the
int value of a header with the specified name and removes the header from this
object. |
Long |
getLong(K name)
Returns the
long value of a header with the specified name. |
long |
getLong(K name,
long defaultValue)
Returns the
long value of a header with the specified name. |
Long |
getLongAndRemove(K name)
Returns the
long value of a header with the specified name and removes the header from this
object. |
long |
getLongAndRemove(K name,
long defaultValue)
Returns the
long value of a header with the specified name and removes the header from this
object. |
Short |
getShort(K name)
Returns the
short value of a header with the specified name. |
short |
getShort(K name,
short defaultValue)
Returns the
short value of a header with the specified name. |
Short |
getShortAndRemove(K name)
Returns the
short value of a header with the specified name and removes the header from this
object. |
short |
getShortAndRemove(K name,
short defaultValue)
Returns the
short value of a header with the specified name and 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
name in milliseconds and removes the header from this
object. |
long |
getTimeMillisAndRemove(K name,
long defaultValue)
Returns the value of a header with the specified
name in milliseconds and removes the header from this
object. |
boolean |
isEmpty()
|
Iterator<Map.Entry<K,V>> |
iterator() |
Set<K> |
names()
Returns a
Set of all header names in this object. |
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 in headers . |
T |
setBoolean(K name,
boolean value)
Set the
name to value . |
T |
setByte(K name,
byte value)
Set the
name to value . |
T |
setChar(K name,
char value)
Set the
name to value . |
T |
setDouble(K name,
double value)
Set the
name to value . |
T |
setFloat(K name,
float value)
Set the
name to value . |
T |
setInt(K name,
int value)
Set the
name to value . |
T |
setLong(K name,
long value)
Set the
name to value . |
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
name to value . |
T |
setTimeMillis(K name,
long value)
Set the
name to value . |
int |
size()
Returns the number of headers in this object.
|
forEach, spliterator
V get(K name)
name
- the name of the header to retrievenull
if there's no such headerV get(K name, V defaultValue)
name
- the name of the header to retrievedefaultValue
- the default valuedefaultValue
if there is no such headerV getAndRemove(K name)
name
- the name of the header to retrievenull
if there is no such headerV getAndRemove(K name, V defaultValue)
name
- the name of the header to retrievedefaultValue
- the default valuedefaultValue
if there is no such headerList<V> getAll(K name)
List
can't be modified.List<V> getAllAndRemove(K name)
List
can't be modified.Boolean getBoolean(K name)
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.name
- the name of the header to retrieveboolean
value of the first value in insertion order or null
if there is no such
value or it can't be converted to boolean
.boolean getBoolean(K name, boolean defaultValue)
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.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
.Byte getByte(K name)
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.name
- the name of the header to retrievebyte
value of the first value in insertion order or null
if there is no such
value or it can't be converted to byte
.byte getByte(K name, byte defaultValue)
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.name
- the name of the header to retrievedefaultValue
- 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
.Character getChar(K name)
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.name
- the name of the header to retrievechar
value of the first value in insertion order or null
if there is no such
value or it can't be converted to char
.char getChar(K name, char defaultValue)
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.name
- the name of the header to retrievedefaultValue
- 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
.Short getShort(K name)
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.name
- the name of the header to retrieveshort
value of the first value in insertion order or null
if there is no such
value or it can't be converted to short
.short getShort(K name, short defaultValue)
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.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
.Integer getInt(K name)
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.name
- the name of the header to retrieveint
value of the first value in insertion order or null
if there is no such
value or it can't be converted to int
.int getInt(K name, int defaultValue)
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.name
- the name of the header to retrievedefaultValue
- 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
.Long getLong(K name)
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.name
- the name of the header to retrievelong
value of the first value in insertion order or null
if there is no such
value or it can't be converted to long
.long getLong(K name, long defaultValue)
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.name
- the name of the header to retrievedefaultValue
- 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
.Float getFloat(K name)
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.name
- the name of the header to retrievefloat
value of the first value in insertion order or null
if there is no such
value or it can't be converted to float
.float getFloat(K name, float defaultValue)
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.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
.Double getDouble(K name)
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.name
- the name of the header to retrievedouble
value of the first value in insertion order or null
if there is no such
value or it can't be converted to double
.double getDouble(K name, double defaultValue)
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.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
.Long getTimeMillis(K name)
name
- the name of the header to retrievenull
if there is no such
value or it can't be converted to milliseconds.long getTimeMillis(K name, long defaultValue)
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.Boolean getBooleanAndRemove(K name)
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.
name
- the name of the header to retrieveboolean
value of the first value in insertion order or null
if there is no
such value or it can't be converted to boolean
.boolean getBooleanAndRemove(K name, boolean defaultValue)
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.
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
.Byte getByteAndRemove(K name)
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.
name
- the name of the header to searchbyte
value of the first value in insertion order or null
if there is no
such value or it can't be converted to byte
.byte getByteAndRemove(K name, byte defaultValue)
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.
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
.Character getCharAndRemove(K name)
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.
name
- the name of the header to searchchar
value of the first value in insertion order or null
if there is no
such value or it can't be converted to char
.char getCharAndRemove(K name, char defaultValue)
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.
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
.Short getShortAndRemove(K name)
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.
name
- the name of the header to searchshort
value of the first value in insertion order or null
if there is no
such value or it can't be converted to short
.short getShortAndRemove(K name, short defaultValue)
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.
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
.Integer getIntAndRemove(K name)
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.
name
- the name of the header to searchint
value of the first value in insertion order or null
if there is no
such value or it can't be converted to int
.int getIntAndRemove(K name, int defaultValue)
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.
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
.Long getLongAndRemove(K name)
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.
name
- the name of the header to searchlong
value of the first value in insertion order or null
if there is no
such value or it can't be converted to long
.long getLongAndRemove(K name, long defaultValue)
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.
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
.Float getFloatAndRemove(K name)
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.
name
- the name of the header to searchfloat
value of the first value in insertion order or null
if there is no
such value or it can't be converted to float
.float getFloatAndRemove(K name, float defaultValue)
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.
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
.Double getDoubleAndRemove(K name)
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.
name
- the name of the header to searchdouble
value of the first value in insertion order or null
if there is no
such value or it can't be converted to double
.double getDoubleAndRemove(K name, double defaultValue)
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.
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
.Long getTimeMillisAndRemove(K name)
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.
name
- the name of the header to retrievenull
if there is no such
value or it can't be converted to milliseconds.long getTimeMillisAndRemove(K name, long defaultValue)
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.
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.boolean contains(K name)
true
if a header with the name
exists, false
otherwise.name
- the header nameboolean contains(K name, V value)
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
.
name
- the header namevalue
- the header value of the header to findboolean containsObject(K name, Object value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseboolean containsBoolean(K name, boolean value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseboolean containsByte(K name, byte value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseboolean containsChar(K name, char value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseboolean containsShort(K name, short value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseboolean containsInt(K name, int value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseboolean containsLong(K name, long value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseboolean containsFloat(K name, float value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseboolean containsDouble(K name, double value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseboolean containsTimeMillis(K name, long value)
true
if a header with the name and value exists.name
- the header namevalue
- the header valuetrue
if it contains it false
otherwiseint size()
boolean isEmpty()
T add(K name, V value)
name
and value
.name
- the name of the headervalue
- the value of the headerthis
T add(K name, Iterable<? extends V> values)
name
and values
. This method is semantically equivalent to
for (T value : values) { headers.add(name, value); }
name
- the header namevalues
- the values of the headerthis
T add(K name, V... values)
name
and values
. This method is semantically equivalent to
for (T value : values) { headers.add(name, value); }
name
- the header namevalues
- the values of the headerthis
T addObject(K name, Object value)
value
is added, it's converted to type T
.name
- the header namevalue
- the value of the headerthis
T addObject(K name, Iterable<?> values)
for (Object v : values) { headers.addObject(name, v); }
name
- the header namevalues
- the value of the headerthis
T addObject(K name, Object... values)
for (Object v : values) { headers.addObject(name, v); }
name
- the header namevalues
- the value of the headerthis
T addBoolean(K name, boolean value)
name
- the header namevalue
- the value of the headerthis
T addByte(K name, byte value)
name
- the header namevalue
- the value of the headerthis
T addChar(K name, char value)
name
- the header namevalue
- the value of the headerthis
T addShort(K name, short value)
name
- the header namevalue
- the value of the headerthis
T addInt(K name, int value)
name
- the header namevalue
- the value of the headerthis
T addLong(K name, long value)
name
- the header namevalue
- the value of the headerthis
T addFloat(K name, float value)
name
- the header namevalue
- the value of the headerthis
T addDouble(K name, double value)
name
- the header namevalue
- the value of the headerthis
T addTimeMillis(K name, long value)
name
- the header namevalue
- the value of the headerthis
T add(Headers<? extends K,? extends V,?> headers)
headers
to this object.this
IllegalArgumentException
- if headers == this
.T set(K name, V value)
name
- the header namevalue
- the value of the headerthis
T set(K name, Iterable<? extends V> values)
for (T v : values) { headers.addObject(name, v); }
name
- the header namevalues
- the value of the headerthis
T set(K name, V... values)
headers.remove(name); for (T v : values) { headers.add(name, v); }
name
- the header namevalues
- the value of the headerthis
T setObject(K name, Object value)
value
is add, it's
converted to type T
.name
- the header namevalue
- the value of the headerthis
NullPointerException
- if either name
or value
before or after its conversion is
null
.T setObject(K name, Iterable<?> values)
headers.remove(name); for (Object v : values) { headers.addObject(name, v); }
name
- the header namevalues
- the values of the headerthis
T setObject(K name, Object... values)
headers.remove(name); for (Object v : values) { headers.addObject(name, v); }
name
- the header namevalues
- the values of the headerthis
T setBoolean(K name, boolean value)
name
to value
. This will remove all previous values associated with name
.name
- The name to modifyvalue
- The valuethis
T setByte(K name, byte value)
name
to value
. This will remove all previous values associated with name
.name
- The name to modifyvalue
- The valuethis
T setChar(K name, char value)
name
to value
. This will remove all previous values associated with name
.name
- The name to modifyvalue
- The valuethis
T setShort(K name, short value)
name
to value
. This will remove all previous values associated with name
.name
- The name to modifyvalue
- The valuethis
T setInt(K name, int value)
name
to value
. This will remove all previous values associated with name
.name
- The name to modifyvalue
- The valuethis
T setLong(K name, long value)
name
to value
. This will remove all previous values associated with name
.name
- The name to modifyvalue
- The valuethis
T setFloat(K name, float value)
name
to value
. This will remove all previous values associated with name
.name
- The name to modifyvalue
- The valuethis
T setDouble(K name, double value)
name
to value
. This will remove all previous values associated with name
.name
- The name to modifyvalue
- The valuethis
T setTimeMillis(K name, long value)
name
to value
. This will remove all previous values associated with name
.name
- The name to modifyvalue
- The valuethis
T set(Headers<? extends K,? extends V,?> headers)
headers
.this
T setAll(Headers<? extends K,? extends V,?> headers)
#set(K, V)
for each entry in headers
.headers
- The headers used to #set(K, V)
values in this instancethis
boolean remove(K name)
name
.name
- the header nametrue
if at least one entry has been removed.Copyright © 2008–2024 The Netty Project. All rights reserved.