Class EmptyHeaders<K,V,T extends Headers<K,V,T>>
- Direct Known Subclasses:
EmptyHttp2Headers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds all header names and values ofheaders
to this object.Adds new headers with the specifiedname
andvalues
.Adds a new header with the specifiedname
andvalue
.Adds new headers with the specifiedname
andvalues
.addBoolean
(K name, boolean value) Adds a new header.Adds a new header.Adds a new header.Adds a new header.Adds a new header.Adds a new header.Adds a new header.Adds a new header with the specified name and values.Adds a new header.Adds a new header with the specified name and values.Adds a new header.addTimeMillis
(K name, long value) Adds a new header.clear()
Removes all headers.boolean
Returnstrue
if a header with thename
exists,false
otherwise.boolean
Returnstrue
if a header with thename
andvalue
exists,false
otherwise.boolean
containsBoolean
(K name, boolean value) Returnstrue
if a header with the name and value exists.boolean
containsByte
(K name, byte value) Returnstrue
if a header with the name and value exists.boolean
containsChar
(K name, char value) Returnstrue
if a header with the name and value exists.boolean
containsDouble
(K name, double value) Returnstrue
if a header with the name and value exists.boolean
containsFloat
(K name, float value) Returnstrue
if a header with the name and value exists.boolean
containsInt
(K name, int value) Returnstrue
if a header with the name and value exists.boolean
containsLong
(K name, long value) Returnstrue
if a header with the name and value exists.boolean
containsObject
(K name, Object value) Returnstrue
if a header with the name and value exists.boolean
containsShort
(K name, short value) Returnstrue
if a header with the name and value exists.boolean
containsTimeMillis
(K name, long value) Returnstrue
if a header with the name and value exists.boolean
Returns the value of a header with the specified name.Returns the value of a header with the specified name.Returns all values for the header with the specified name.getAllAndRemove
(K name) Returns all values for the header with the specified name and removes them from this object.getAndRemove
(K name) Returns the value of a header with the specified name and removes it from this object.getAndRemove
(K name, V defaultValue) Returns the value of a header with the specified name and removes it from this object.getBoolean
(K name) Returns theboolean
value of a header with the specified name.boolean
getBoolean
(K name, boolean defaultValue) Returns theboolean
value of a header with the specified name.getBooleanAndRemove
(K name) Returns theboolean
value of a header with the specifiedname
and removes the header from this object.boolean
getBooleanAndRemove
(K name, boolean defaultValue) Returns theboolean
value of a header with the specifiedname
and removes the header from this object.Returns thebyte
value of a header with the specified name.byte
Returns thebyte
value of a header with the specified name.getByteAndRemove
(K name) Returns thebyte
value of a header with the specifiedname
and removes the header from this object.byte
getByteAndRemove
(K name, byte defaultValue) Returns thebyte
value of a header with the specifiedname
and removes the header from this object.Returns thechar
value of a header with the specified name.char
Returns thechar
value of a header with the specified name.getCharAndRemove
(K name) Returns thechar
value of a header with the specifiedname
and removes the header from this object.char
getCharAndRemove
(K name, char defaultValue) Returns thechar
value of a header with the specifiedname
and removes the header from this object.Returns thedouble
value of a header with the specified name.double
Returns thedouble
value of a header with the specified name.getDoubleAndRemove
(K name) Returns thedouble
value of a header with the specifiedname
and removes the header from this object.double
getDoubleAndRemove
(K name, double defaultValue) Returns thedouble
value of a header with the specifiedname
and removes the header from this object.Returns thefloat
value of a header with the specified name.float
Returns thefloat
value of a header with the specified name.getFloatAndRemove
(K name) Returns thefloat
value of a header with the specifiedname
and removes the header from this object.float
getFloatAndRemove
(K name, float defaultValue) Returns thefloat
value of a header with the specifiedname
and removes the header from this object.Returns theint
value of a header with the specified name.int
Returns theint
value of a header with the specified name.getIntAndRemove
(K name) Returns theint
value of a header with the specifiedname
and removes the header from this object.int
getIntAndRemove
(K name, int defaultValue) Returns theint
value of a header with the specifiedname
and removes the header from this object.Returns thelong
value of a header with the specified name.long
Returns thelong
value of a header with the specified name.getLongAndRemove
(K name) Returns thelong
value of a header with the specifiedname
and removes the header from this object.long
getLongAndRemove
(K name, long defaultValue) Returns thelong
value of a header with the specifiedname
and removes the header from this object.Returns theshort
value of a header with the specified name.short
Returns theshort
value of a header with the specified name.getShortAndRemove
(K name) Returns theshort
value of a header with the specifiedname
and removes the header from this object.short
getShortAndRemove
(K name, short defaultValue) Returns theshort
value of a header with the specifiedname
and removes the header from this object.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.getTimeMillisAndRemove
(K name) Returns the value of a header with the specifiedname
in milliseconds and removes the header from this object.long
getTimeMillisAndRemove
(K name, long defaultValue) Returns the value of a header with the specifiedname
in milliseconds and removes the header from this object.int
hashCode()
boolean
isEmpty()
iterator()
names()
Returns aSet
of all header names in this object.boolean
Removes all headers with the specifiedname
.Clears the current header entries and copies all header entries of the specifiedheaders
.Sets a new header with the specified name and values.Sets a header with the specified name and value.Sets a header with the specified name and values.Retains all current headers but callsHeaders.set(K, V)
for each entry inheaders
.setBoolean
(K name, boolean value) Set thename
tovalue
.Set thename
tovalue
.Set thename
tovalue
.Set thename
tovalue
.Set thename
tovalue
.Set thename
tovalue
.Set thename
tovalue
.Sets a header with the specified name and values.Sets a new header.Sets a header with the specified name and values.Set thename
tovalue
.setTimeMillis
(K name, long value) Set thename
tovalue
.int
size()
Returns the number of headers in this object.private T
thisT()
toString()
valueIterator
(K name) Equivalent togetAll(Object)
but no intermediate list is generated.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
EmptyHeaders
public EmptyHeaders()
-
-
Method Details
-
get
Description copied from interface:Headers
Returns the value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned. -
get
Description copied from interface:Headers
Returns the value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned. -
getAndRemove
Description copied from interface:Headers
Returns the value of a header with the specified name and removes it from this object. If there is more than one value for the specified name, the first value in insertion order is returned. -
getAndRemove
Description copied from interface:Headers
Returns the value of a header with the specified name and removes it from this object. If there is more than one value for the specified name, the first value in insertion order is returned. -
getAll
Description copied from interface:Headers
Returns all values for the header with the specified name. The returnedList
can't be modified. -
getAllAndRemove
Description copied from interface:Headers
Returns all values for the header with the specified name and removes them from this object. The returnedList
can't be modified. -
getBoolean
Description copied from interface:Headers
Returns theboolean
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
Description copied from interface:Headers
Returns theboolean
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getBoolean
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
boolean
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toboolean
.
-
getByte
Description copied from interface:Headers
Returns thebyte
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. -
getByte
Description copied from interface:Headers
Returns thebyte
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. -
getChar
Description copied from interface:Headers
Returns thechar
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. -
getChar
Description copied from interface:Headers
Returns thechar
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
Description copied from interface:Headers
Returns theshort
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
Description copied from interface:Headers
Returns theshort
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getShort
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
short
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toshort
.
-
getInt
Description copied from interface:Headers
Returns theint
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. -
getInt
Description copied from interface:Headers
Returns theint
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. -
getLong
Description copied from interface:Headers
Returns thelong
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. -
getLong
Description copied from interface:Headers
Returns thelong
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
Description copied from interface:Headers
Returns thefloat
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
Description copied from interface:Headers
Returns thefloat
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getFloat
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
float
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tofloat
.
-
getDouble
Description copied from interface:Headers
Returns thedouble
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
Description copied from interface:Headers
Returns thedouble
value of a header with the specified name. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getDouble
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the
double
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted todouble
.
-
getTimeMillis
Description copied from interface:Headers
Returns the value of a header with the specified name in milliseconds. If there is more than one value for the specified name, the first value in insertion order is returned. -
getTimeMillis
Description copied from interface:Headers
Returns the value of a header with the specified name in milliseconds. If there is more than one value for the specified name, the first value in insertion order is returned.- Specified by:
getTimeMillis
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the milliseconds value of the first value in insertion order or
defaultValue
if there is no such value or it can't be converted to milliseconds.
-
getBooleanAndRemove
Description copied from interface:Headers
Returns theboolean
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed. -
getBooleanAndRemove
Description copied from interface:Headers
Returns theboolean
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getBooleanAndRemove
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
boolean
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toboolean
.
-
getByteAndRemove
Description copied from interface:Headers
Returns thebyte
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed. -
getByteAndRemove
Description copied from interface:Headers
Returns thebyte
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getByteAndRemove
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
byte
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tobyte
.
-
getCharAndRemove
Description copied from interface:Headers
Returns thechar
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed. -
getCharAndRemove
Description copied from interface:Headers
Returns thechar
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getCharAndRemove
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
char
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tochar
.
-
getShortAndRemove
Description copied from interface:Headers
Returns theshort
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed. -
getShortAndRemove
Description copied from interface:Headers
Returns theshort
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getShortAndRemove
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
short
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toshort
.
-
getIntAndRemove
Description copied from interface:Headers
Returns theint
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed. -
getIntAndRemove
Description copied from interface:Headers
Returns theint
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getIntAndRemove
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
int
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted toint
.
-
getLongAndRemove
Description copied from interface:Headers
Returns thelong
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed. -
getLongAndRemove
Description copied from interface:Headers
Returns thelong
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getLongAndRemove
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
long
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tolong
.
-
getFloatAndRemove
Description copied from interface:Headers
Returns thefloat
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed. -
getFloatAndRemove
Description copied from interface:Headers
Returns thefloat
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getFloatAndRemove
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
float
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted tofloat
.
-
getDoubleAndRemove
Description copied from interface:Headers
Returns thedouble
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed. -
getDoubleAndRemove
Description copied from interface:Headers
Returns thedouble
value of a header with the specifiedname
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 forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getDoubleAndRemove
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to searchdefaultValue
- the default value- Returns:
- the
double
value of the first value in insertion order ordefaultValue
if there is no such value or it can't be converted todouble
.
-
getTimeMillisAndRemove
Description copied from interface:Headers
Returns the value of a header with the specifiedname
in milliseconds and removes the header from this object. If there is more than one value for the specifiedname
, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed. -
getTimeMillisAndRemove
Description copied from interface:Headers
Returns the value of a header with the specifiedname
in milliseconds and removes the header from this object. If there is more than one value for the specifiedname
, the first value in insertion order is returned. In any case all values forname
are removed.If an exception occurs during the translation from type
T
all entries withname
may still be removed.- Specified by:
getTimeMillisAndRemove
in interfaceHeaders<K,
V, T extends Headers<K, V, T>> - Parameters:
name
- the name of the header to retrievedefaultValue
- the default value- Returns:
- the milliseconds value of the first value in insertion order or
defaultValue
if there is no such value or it can't be converted to milliseconds.
-
contains
Description copied from interface:Headers
Returnstrue
if a header with thename
exists,false
otherwise. -
contains
Description copied from interface:Headers
Returnstrue
if a header with thename
andvalue
exists,false
otherwise.The
Object.equals(Object)
method is used to test for equality ofvalue
. -
containsObject
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
containsBoolean
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
containsByte
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
containsChar
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
containsShort
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
containsInt
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
containsLong
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
containsFloat
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
containsDouble
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
containsTimeMillis
Description copied from interface:Headers
Returnstrue
if a header with the name and value exists. -
size
public int size()Description copied from interface:Headers
Returns the number of headers in this object. -
isEmpty
public boolean isEmpty()Description copied from interface:Headers
-
names
Description copied from interface:Headers
-
add
Description copied from interface:Headers
Adds a new header with the specifiedname
andvalue
. -
add
Description copied from interface:Headers
Adds new headers with the specifiedname
andvalues
. This method is semantically equivalent tofor (T value : values) { headers.add(name, value); }
-
add
Description copied from interface:Headers
Adds new headers with the specifiedname
andvalues
. This method is semantically equivalent tofor (T value : values) { headers.add(name, value); }
-
addObject
Description copied from interface:Headers
Adds a new header. Before thevalue
is added, it's converted to typeT
. -
addObject
Description copied from interface:Headers
Adds a new header with the specified name and values. This method is equivalent tofor (Object v : values) { headers.addObject(name, v); }
-
addObject
Description copied from interface:Headers
Adds a new header with the specified name and values. This method is equivalent tofor (Object v : values) { headers.addObject(name, v); }
-
addBoolean
Description copied from interface:Headers
Adds a new header. -
addByte
Description copied from interface:Headers
Adds a new header. -
addChar
Description copied from interface:Headers
Adds a new header. -
addShort
Description copied from interface:Headers
Adds a new header. -
addInt
Description copied from interface:Headers
Adds a new header. -
addLong
Description copied from interface:Headers
Adds a new header. -
addFloat
Description copied from interface:Headers
Adds a new header. -
addDouble
Description copied from interface:Headers
Adds a new header. -
addTimeMillis
Description copied from interface:Headers
Adds a new header. -
add
Description copied from interface:Headers
Adds all header names and values ofheaders
to this object. -
set
Description copied from interface:Headers
Sets a header with the specified name and value. Any existing headers with the same name are overwritten. -
set
Description copied from interface:Headers
Sets a new header with the specified name and values. This method is equivalent tofor (T v : values) { headers.addObject(name, v); }
-
set
Description copied from interface:Headers
Sets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:headers.remove(name); for (T v : values) { headers.add(name, v); }
-
setObject
Description copied from interface:Headers
Sets a new header. Any existing headers with this name are removed. Before thevalue
is add, it's converted to typeT
. -
setObject
Description copied from interface:Headers
Sets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:headers.remove(name); for (Object v : values) { headers.addObject(name, v); }
-
setObject
Description copied from interface:Headers
Sets a header with the specified name and values. Any existing headers with this name are removed. This method is equivalent to:headers.remove(name); for (Object v : values) { headers.addObject(name, v); }
-
setBoolean
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
. -
setByte
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
. -
setChar
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
. -
setShort
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
. -
setInt
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
. -
setLong
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
. -
setFloat
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
. -
setDouble
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
. -
setTimeMillis
Description copied from interface:Headers
Set thename
tovalue
. This will remove all previous values associated withname
. -
set
Description copied from interface:Headers
Clears the current header entries and copies all header entries of the specifiedheaders
. -
setAll
Description copied from interface:Headers
Retains all current headers but callsHeaders.set(K, V)
for each entry inheaders
. -
remove
Description copied from interface:Headers
Removes all headers with the specifiedname
. -
clear
Description copied from interface:Headers
Removes all headers. After a call to this methodHeaders.size()
equals0
. -
valueIterator
Equivalent togetAll(Object)
but no intermediate list is generated.- Parameters:
name
- the name of the header to retrieve- Returns:
- an
Iterator
of header values corresponding toname
.
-
iterator
-
equals
-
hashCode
public int hashCode() -
toString
-
thisT
-