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 java.lang.Object implements Headers<K,V,T>
Headers
;限定符和类型 | 类和说明 |
---|---|
protected static class |
DefaultHeaders.HeaderEntry<K,V> |
static interface |
DefaultHeaders.NameValidator<K> |
static interface |
DefaultHeaders.ValueValidator<V> |
限定符和类型 | 字段和说明 |
---|---|
protected DefaultHeaders.HeaderEntry<K,V> |
head |
构造器和说明 |
---|
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) |
限定符和类型 | 方法和说明 |
---|---|
T |
add(Headers<? extends K,? extends V,?> headers)
Adds all header names and values of
headers to this object. |
T |
add(K name,
java.lang.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.
|
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,
java.lang.Iterable<?> values)
Adds a new header with the specified name and values.
|
T |
addObject(K name,
java.lang.Object... values)
Adds a new header with the specified name and values.
|
T |
addObject(K name,
java.lang.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 |
contains(K name,
V value,
HashingStrategy<? super V> valueHashingStrategy) |
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,
java.lang.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. |
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(java.lang.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.
|
java.util.List<V> |
getAll(K name)
Returns all values for the header with the specified name.
|
java.util.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.
|
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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. |
java.lang.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.
|
java.lang.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() |
int |
hashCode(HashingStrategy<V> valueHashingStrategy)
Generate a hash code for this object given a
HashingStrategy to generate hash codes for
individual values. |
boolean |
isEmpty()
|
java.util.Iterator<java.util.Map.Entry<K,V>> |
iterator() |
java.util.Set<K> |
names()
Returns a
Set of 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,
java.lang.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,
java.lang.Iterable<?> values)
Sets a header with the specified name and values.
|
T |
setObject(K name,
java.lang.Object... values)
Sets a header with the specified name and values.
|
T |
setObject(K name,
java.lang.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.
|
java.lang.String |
toString() |
protected void |
validateName(DefaultHeaders.NameValidator<K> validator,
boolean forAdd,
K name)
Call out to the given
DefaultHeaders.NameValidator to validate the given name. |
protected void |
validateValue(DefaultHeaders.ValueValidator<V> validator,
K name,
V value) |
protected ValueConverter<V> |
valueConverter() |
java.util.Iterator<V> |
valueIterator(K name)
Equivalent to
getAll(Object) but no intermediate list is generated. |
protected DefaultHeaders.ValueValidator<V> |
valueValidator() |
protected 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)
Headers
public V get(K name, V defaultValue)
Headers
public V getAndRemove(K name)
Headers
public V getAndRemove(K name, V defaultValue)
Headers
public java.util.List<V> getAll(K name)
Headers
List
can't be modified.public java.util.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 java.util.List<V> getAllAndRemove(K name)
Headers
List
can't be modified.public boolean contains(K name)
Headers
true
if a header with the name
exists, false
otherwise.public boolean containsObject(K name, java.lang.Object value)
Headers
true
if a header with the name and value exists.public boolean containsBoolean(K name, boolean value)
Headers
true
if a header with the name and value exists.public boolean containsByte(K name, byte value)
Headers
true
if a header with the name and value exists.public boolean containsChar(K name, char value)
Headers
true
if a header with the name and value exists.public boolean containsShort(K name, short value)
Headers
true
if a header with the name and value exists.public boolean containsInt(K name, int value)
Headers
true
if a header with the name and value exists.public boolean containsLong(K name, long value)
Headers
true
if a header with the name and value exists.public boolean containsFloat(K name, float value)
Headers
true
if a header with the name and value exists.public boolean containsDouble(K name, double value)
Headers
true
if a header with the name and value exists.public boolean containsTimeMillis(K name, long value)
Headers
true
if a header with the name and value exists.public boolean contains(K name, V value)
Headers
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
.
public final boolean contains(K name, V value, HashingStrategy<? super V> valueHashingStrategy)
public int size()
Headers
public boolean isEmpty()
Headers
public java.util.Set<K> names()
Headers
Set
of all header names in this object. The returned Set
cannot be modified.public T add(K name, V value)
Headers
name
and value
.public T add(K name, java.lang.Iterable<? extends V> values)
Headers
name
and values
. This method is semantically equivalent to
for (T value : values) { headers.add(name, value); }
public T add(K name, V... values)
Headers
name
and values
. This method is semantically equivalent to
for (T value : values) { headers.add(name, value); }
public T addObject(K name, java.lang.Object value)
Headers
value
is added, it's converted to type T
.public T addObject(K name, java.lang.Iterable<?> values)
Headers
for (Object v : values) { headers.addObject(name, v); }
public T addObject(K name, java.lang.Object... values)
Headers
for (Object v : values) { headers.addObject(name, v); }
public T add(Headers<? extends K,? extends V,?> headers)
Headers
headers
to this object.public T set(K name, V value)
Headers
public T set(K name, java.lang.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, java.lang.Object value)
Headers
value
is add, it's
converted to type T
.public T setObject(K name, java.lang.Iterable<?> values)
Headers
headers.remove(name); for (Object v : values) { headers.addObject(name, v); }
public T setObject(K name, java.lang.Object... values)
Headers
headers.remove(name); for (Object v : values) { headers.addObject(name, v); }
public T setInt(K name, int value)
Headers
name
to value
. This will remove all previous values associated with name
.public T setLong(K name, long value)
Headers
name
to value
. This will remove all previous values associated with name
.public T setDouble(K name, double value)
Headers
name
to value
. This will remove all previous values associated with name
.public T setTimeMillis(K name, long value)
Headers
name
to value
. This will remove all previous values associated with name
.public T setFloat(K name, float value)
Headers
name
to value
. This will remove all previous values associated with name
.public T setChar(K name, char value)
Headers
name
to value
. This will remove all previous values associated with name
.public T setBoolean(K name, boolean value)
Headers
name
to value
. This will remove all previous values associated with name
.public T setByte(K name, byte value)
Headers
name
to value
. This will remove all previous values associated with name
.public T setShort(K name, short value)
Headers
name
to value
. This will remove all previous values associated with name
.public T set(Headers<? extends K,? extends V,?> headers)
Headers
headers
.public T setAll(Headers<? extends K,? extends V,?> headers)
Headers
#set(K, V)
for each entry in headers
.public T clear()
Headers
Headers.size()
equals 0
.public java.lang.Boolean getBoolean(K name)
Headers
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.public boolean getBoolean(K name, boolean defaultValue)
Headers
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.public java.lang.Byte getByte(K name)
Headers
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.public byte getByte(K name, byte defaultValue)
Headers
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.public java.lang.Character getChar(K name)
Headers
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.public char getChar(K name, char defaultValue)
Headers
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.public java.lang.Short getShort(K name)
Headers
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.public short getShort(K name, short defaultValue)
Headers
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.public java.lang.Integer getInt(K name)
Headers
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.public int getInt(K name, int defaultValue)
Headers
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.public java.lang.Long getLong(K name)
Headers
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.public long getLong(K name, long defaultValue)
Headers
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.public java.lang.Float getFloat(K name)
Headers
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.public float getFloat(K name, float defaultValue)
Headers
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.public java.lang.Double getDouble(K name)
Headers
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.public double getDouble(K name, double defaultValue)
Headers
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.public java.lang.Long getTimeMillis(K name)
Headers
public long getTimeMillis(K name, long defaultValue)
Headers
public java.lang.Boolean getBooleanAndRemove(K name)
Headers
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.
public boolean getBooleanAndRemove(K name, boolean defaultValue)
Headers
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.
public java.lang.Byte getByteAndRemove(K name)
Headers
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.
public byte getByteAndRemove(K name, byte defaultValue)
Headers
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.
public java.lang.Character getCharAndRemove(K name)
Headers
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.
public char getCharAndRemove(K name, char defaultValue)
Headers
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.
public java.lang.Short getShortAndRemove(K name)
Headers
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.
public short getShortAndRemove(K name, short defaultValue)
Headers
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.
public java.lang.Integer getIntAndRemove(K name)
Headers
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.
public int getIntAndRemove(K name, int defaultValue)
Headers
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.
public java.lang.Long getLongAndRemove(K name)
Headers
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.
public long getLongAndRemove(K name, long defaultValue)
Headers
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.
public java.lang.Float getFloatAndRemove(K name)
Headers
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.
public float getFloatAndRemove(K name, float defaultValue)
Headers
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.
public java.lang.Double getDoubleAndRemove(K name)
Headers
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.
public double getDoubleAndRemove(K name, double defaultValue)
Headers
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.
public java.lang.Long getTimeMillisAndRemove(K name)
Headers
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.
public long getTimeMillisAndRemove(K name, long defaultValue)
Headers
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.
public boolean equals(java.lang.Object o)
equals
在类中 java.lang.Object
public int hashCode()
hashCode
在类中 java.lang.Object
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.public java.lang.String toString()
toString
在类中 java.lang.Object
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()