| Constructor and Description |
|---|
EmptyHeaders() |
| 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. |
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
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. |
int |
hashCode() |
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.
|
String |
toString() |
Iterator<V> |
valueIterator(K name)
Equivalent to
getAll(Object) but no intermediate list is generated. |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic 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 List<V> getAllAndRemove(K name)
HeadersList can't be modified.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 boolean contains(K name)
Headerstrue if a header with the name exists, false otherwise.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 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 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 addBoolean(K name, boolean value)
Headerspublic T addByte(K name, byte value)
Headerspublic T addChar(K name, char value)
Headerspublic T addShort(K name, short value)
Headerspublic T addInt(K name, int value)
Headerspublic T addLong(K name, long value)
Headerspublic T addFloat(K name, float value)
Headerspublic T addDouble(K name, double value)
Headerspublic T addTimeMillis(K name, long 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 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 setChar(K name, char 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 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 setFloat(K name, float 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 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 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.Copyright © 2008–2019 The Netty Project. All rights reserved.