Top Description Methods
io.netty.handler.codec

public Interface Headers<K, V, T extends Headers<K, V, T>>

extends Iterable<Map.Entry<K, V>>
Known Direct Implementers
io.netty.handler.codec.DefaultHeaders, io.netty.handler.codec.EmptyHeaders
Type Parameters
<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.
Imports
java.util.Iterator, .List, .Map.Entry, .Set

Common interface for Headers which represents a mapping of key to value. Duplicate keys may be allowed by implementations.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

this
add
(K
the name of the header
name
,
V
the value of the header
value
)

Adds a new header with the specified name and value.

public T

Returns:

this
add
(K
the header name
name
,
Iterable<? extends V>
the values of the header
values
)

Adds new headers with the specified name and values.

public T

Returns:

this
add
(K
the header name
name
,
V...
the values of the header
values
)

Adds new headers with the specified name and values.

public T

Returns:

this
add
(Headers<? extends K, ? extends V, ?> headers)

Adds all header names and values of headers to this object.

public T

Returns:

this
addBoolean
(K
the header name
name
,
boolean
the value of the header
value
)

Adds a new header.

public T

Returns:

this
addByte
(K
the header name
name
,
byte
the value of the header
value
)

Adds a new header.

public T

Returns:

this
addChar
(K
the header name
name
,
char
the value of the header
value
)

Adds a new header.

public T

Returns:

this
addDouble
(K
the header name
name
,
double
the value of the header
value
)

Adds a new header.

public T

Returns:

this
addFloat
(K
the header name
name
,
float
the value of the header
value
)

Adds a new header.

public T

Returns:

this
addInt
(K
the header name
name
,
int
the value of the header
value
)

Adds a new header.

public T

Returns:

this
addLong
(K
the header name
name
,
long
the value of the header
value
)

Adds a new header.

public T

Returns:

this
addObject
(K
the header name
name
,
Object
the value of the header
value
)

Adds a new header.

public T

Returns:

this
addObject
(K
the header name
name
,
Iterable<?>
the value of the header
values
)

Adds a new header with the specified name and values.

public T

Returns:

this
addObject
(K
the header name
name
,
Object...
the value of the header
values
)

Adds a new header with the specified name and values.

public T

Returns:

this
addShort
(K
the header name
name
,
short
the value of the header
value
)

Adds a new header.

public T

Returns:

this
addTimeMillis
(K
the header name
name
,
long
the value of the header
value
)

Adds a new header.

public T

Returns:

this
clear
()

Removes all headers.

public boolean
contains(K
the header name
name
)

Returns true if a header with the name exists, false otherwise.

public boolean
contains(K
the header name
name
,
V
the header value of the header to find
value
)

Returns true if a header with the name and value exists, false otherwise.

public boolean

Returns:

true if it contains it false otherwise
containsBoolean
(K
the header name
name
,
boolean
the header value
value
)

Returns true if a header with the name and value exists.

public boolean

Returns:

true if it contains it false otherwise
containsByte
(K
the header name
name
,
byte
the header value
value
)

Returns true if a header with the name and value exists.

public boolean

Returns:

true if it contains it false otherwise
containsChar
(K
the header name
name
,
char
the header value
value
)

Returns true if a header with the name and value exists.

public boolean

Returns:

true if it contains it false otherwise
containsDouble
(K
the header name
name
,
double
the header value
value
)

Returns true if a header with the name and value exists.

public boolean

Returns:

true if it contains it false otherwise
containsFloat
(K
the header name
name
,
float
the header value
value
)

Returns true if a header with the name and value exists.

public boolean

Returns:

true if it contains it false otherwise
containsInt
(K
the header name
name
,
int
the header value
value
)

Returns true if a header with the name and value exists.

public boolean

Returns:

true if it contains it false otherwise
containsLong
(K
the header name
name
,
long
the header value
value
)

Returns true if a header with the name and value exists.

public boolean

Returns:

true if it contains it false otherwise
containsObject
(K
the header name
name
,
Object
the header value
value
)

Returns true if a header with the name and value exists.

public boolean

Returns:

true if it contains it false otherwise
containsShort
(K
the header name
name
,
short
the header value
value
)

Returns true if a header with the name and value exists.

public boolean

Returns:

true if it contains it false otherwise
containsTimeMillis
(K
the header name
name
,
long
the header value
value
)

Returns true if a header with the name and value exists.

public V

Returns:

the first header value if the header is found. null if there's no such header
get
(K
the name of the header to retrieve
name
)

Returns the value of a header with the specified name.

public V

Returns:

the first header value or defaultValue if there is no such header
get
(K
the name of the header to retrieve
name
,
V
the default value
defaultValue
)

Returns the value of a header with the specified name.

public List<V>

Returns:

a List of header values or an empty List if no values are found.
getAll
(K
the name of the header to retrieve
name
)

Returns all values for the header with the specified name.

public List<V>

Returns:

a List of header values or an empty List if no values are found.
getAllAndRemove
(K
the name of the header to retrieve
name
)

Returns all values for the header with the specified name and removes them from this object.

public V

Returns:

the first header value or null if there is no such header
getAndRemove
(K
the name of the header to retrieve
name
)

Returns the value of a header with the specified name and removes it from this object.

public V

Returns:

the first header value or defaultValue if there is no such header
getAndRemove
(K
the name of the header to retrieve
name
,
V
the default value
defaultValue
)

Returns the value of a header with the specified name and removes it from this object.

public Boolean

Returns:

the boolean value of the first value in insertion order or null if there is no such value or it can't be converted to boolean.
getBoolean
(K
the name of the header to retrieve
name
)

Returns the boolean value of a header with the specified name.

public boolean

Returns:

the boolean value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to boolean.
getBoolean
(K
the name of the header to retrieve
name
,
boolean
the default value
defaultValue
)

Returns the boolean value of a header with the specified name.

public Boolean

Returns:

the boolean value of the first value in insertion order or null if there is no such value or it can't be converted to boolean.
getBooleanAndRemove
(K
the name of the header to retrieve
name
)

Returns the boolean value of a header with the specified name and removes the header from this object.

public boolean

Returns:

the boolean value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to boolean.
getBooleanAndRemove
(K
the name of the header to search
name
,
boolean
the default value
defaultValue
)

Returns the boolean value of a header with the specified name and removes the header from this object.

public Byte

Returns:

the byte value of the first value in insertion order or null if there is no such value or it can't be converted to byte.
getByte
(K
the name of the header to retrieve
name
)

Returns the byte value of a header with the specified name.

public byte

Returns:

the byte value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to byte.
getByte
(K
the name of the header to retrieve
name
,
byte
the default value
defaultValue
)

Returns the byte value of a header with the specified name.

public Byte

Returns:

the byte value of the first value in insertion order or null if there is no such value or it can't be converted to byte.
getByteAndRemove
(K
the name of the header to search
name
)

Returns the byte value of a header with the specified name and removes the header from this object.

public byte

Returns:

the byte value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to byte.
getByteAndRemove
(K
the name of the header to search
name
,
byte
the default value
defaultValue
)

Returns the byte value of a header with the specified name and removes the header from this object.

public Character

Returns:

the char value of the first value in insertion order or null if there is no such value or it can't be converted to char.
getChar
(K
the name of the header to retrieve
name
)

Returns the char value of a header with the specified name.

public char

Returns:

the char value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to char.
getChar
(K
the name of the header to retrieve
name
,
char
the default value
defaultValue
)

Returns the char value of a header with the specified name.

public Character

Returns:

the char value of the first value in insertion order or null if there is no such value or it can't be converted to char.
getCharAndRemove
(K
the name of the header to search
name
)

Returns the char value of a header with the specified name and removes the header from this object.

public char

Returns:

the char value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to char.
getCharAndRemove
(K
the name of the header to search
name
,
char
the default value
defaultValue
)

Returns the char value of a header with the specified name and removes the header from this object.

public Double

Returns:

the double value of the first value in insertion order or null if there is no such value or it can't be converted to double.
getDouble
(K
the name of the header to retrieve
name
)

Returns the double value of a header with the specified name.

public double

Returns:

the double value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to double.
getDouble
(K
the name of the header to retrieve
name
,
double
the default value
defaultValue
)

Returns the double value of a header with the specified name.

public Double

Returns:

the double value of the first value in insertion order or null if there is no such value or it can't be converted to double.
getDoubleAndRemove
(K
the name of the header to search
name
)

Returns the double value of a header with the specified name and removes the header from this object.

public double

Returns:

the double value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to double.
getDoubleAndRemove
(K
the name of the header to search
name
,
double
the default value
defaultValue
)

Returns the double value of a header with the specified name and removes the header from this object.

public Float

Returns:

the float value of the first value in insertion order or null if there is no such value or it can't be converted to float.
getFloat
(K
the name of the header to retrieve
name
)

Returns the float value of a header with the specified name.

public float

Returns:

the float value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to float.
getFloat
(K
the name of the header to retrieve
name
,
float
the default value
defaultValue
)

Returns the float value of a header with the specified name.

public Float

Returns:

the float value of the first value in insertion order or null if there is no such value or it can't be converted to float.
getFloatAndRemove
(K
the name of the header to search
name
)

Returns the float value of a header with the specified name and removes the header from this object.

public float

Returns:

the float value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to float.
getFloatAndRemove
(K
the name of the header to search
name
,
float
the default value
defaultValue
)

Returns the float value of a header with the specified name and removes the header from this object.

public Integer

Returns:

the int value of the first value in insertion order or null if there is no such value or it can't be converted to int.
getInt
(K
the name of the header to retrieve
name
)

Returns the int value of a header with the specified name.

public int

Returns:

the int value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to int.
getInt
(K
the name of the header to retrieve
name
,
int
the default value
defaultValue
)

Returns the int value of a header with the specified name.

public Integer

Returns:

the int value of the first value in insertion order or null if there is no such value or it can't be converted to int.
getIntAndRemove
(K
the name of the header to search
name
)

Returns the int value of a header with the specified name and removes the header from this object.

public int

Returns:

the int value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to int.
getIntAndRemove
(K
the name of the header to search
name
,
int
the default value
defaultValue
)

Returns the int value of a header with the specified name and removes the header from this object.

public Long

Returns:

the long value of the first value in insertion order or null if there is no such value or it can't be converted to long.
getLong
(K
the name of the header to retrieve
name
)

Returns the long value of a header with the specified name.

public long

Returns:

the long value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to long.
getLong
(K
the name of the header to retrieve
name
,
long
the default value
defaultValue
)

Returns the long value of a header with the specified name.

public Long

Returns:

the long value of the first value in insertion order or null if there is no such value or it can't be converted to long.
getLongAndRemove
(K
the name of the header to search
name
)

Returns the long value of a header with the specified name and removes the header from this object.

public long

Returns:

the long value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to long.
getLongAndRemove
(K
the name of the header to search
name
,
long
the default value
defaultValue
)

Returns the long value of a header with the specified name and removes the header from this object.

public Short

Returns:

the short value of the first value in insertion order or null if there is no such value or it can't be converted to short.
getShort
(K
the name of the header to retrieve
name
)

Returns the short value of a header with the specified name.

public short

Returns:

the short value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to short.
getShort
(K
the name of the header to retrieve
name
,
short
the default value
defaultValue
)

Returns the short value of a header with the specified name.

public Short

Returns:

the short value of the first value in insertion order or null if there is no such value or it can't be converted to short.
getShortAndRemove
(K
the name of the header to search
name
)

Returns the short value of a header with the specified name and removes the header from this object.

public short

Returns:

the short value of the first value in insertion order or defaultValue if there is no such value or it can't be converted to short.
getShortAndRemove
(K
the name of the header to search
name
,
short
the default value
defaultValue
)

Returns the short value of a header with the specified name and removes the header from this object.

public Long

Returns:

the milliseconds value of the first value in insertion order or null if there is no such value or it can't be converted to milliseconds.
getTimeMillis
(K
the name of the header to retrieve
name
)

Returns the value of a header with the specified name in milliseconds.

public long

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.
getTimeMillis
(K
the name of the header to retrieve
name
,
long
the default value
defaultValue
)

Returns the value of a header with the specified name in milliseconds.

public Long

Returns:

the milliseconds value of the first value in insertion order or null if there is no such value or it can't be converted to milliseconds.
getTimeMillisAndRemove
(K
the name of the header to retrieve
name
)

Returns the value of a header with the specified name in milliseconds and removes the header from this object.

public long

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.
getTimeMillisAndRemove
(K
the name of the header to retrieve
name
,
long
the default value
defaultValue
)

Returns the value of a header with the specified name in milliseconds and removes the header from this object.

public boolean
isEmpty()

Returns true if size() equals 0.

public Iterator<Map.Entry<K, V>>
iterator()

Redeclares java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public Set<K>
names()

Returns a Set of all header names in this object.

public boolean

Returns:

true if at least one entry has been removed.
remove
(K
the header name
name
)

Removes all headers with the specified name.

public T

Returns:

this
set
(K
the header name
name
,
V
the value of the header
value
)

Sets a header with the specified name and value.

public T

Returns:

this
set
(K
the header name
name
,
Iterable<? extends V>
the value of the header
values
)

Sets a new header with the specified name and values.

public T

Returns:

this
set
(K
the header name
name
,
V...
the value of the header
values
)

Sets a header with the specified name and values.

public T

Returns:

this
set
(Headers<? extends K, ? extends V, ?> headers)

Clears the current header entries and copies all header entries of the specified headers.

public T

Returns:

this
setAll
(Headers<? extends K, ? extends V, ?>
The headers used to set(K, V) values in this instance
headers
)

Retains all current headers but calls set(K, V) for each entry in headers.

public T

Returns:

this
setBoolean
(K
The name to modify
name
,
boolean
The value
value
)

Set the name to value.

public T

Returns:

this
setByte
(K
The name to modify
name
,
byte
The value
value
)

Set the name to value.

public T

Returns:

this
setChar
(K
The name to modify
name
,
char
The value
value
)

Set the name to value.

public T

Returns:

this
setDouble
(K
The name to modify
name
,
double
The value
value
)

Set the name to value.

public T

Returns:

this
setFloat
(K
The name to modify
name
,
float
The value
value
)

Set the name to value.

public T

Returns:

this
setInt
(K
The name to modify
name
,
int
The value
value
)

Set the name to value.

public T

Returns:

this
setLong
(K
The name to modify
name
,
long
The value
value
)

Set the name to value.

public T

Returns:

this
setObject
(K
the header name
name
,
Object
the value of the header
value
)

Sets a new header.

public T

Returns:

this
setObject
(K
the header name
name
,
Iterable<?>
the values of the header
values
)

Sets a header with the specified name and values.

public T

Returns:

this
setObject
(K
the header name
name
,
Object...
the values of the header
values
)

Sets a header with the specified name and values.

public T

Returns:

this
setShort
(K
The name to modify
name
,
short
The value
value
)

Set the name to value.

public T

Returns:

this
setTimeMillis
(K
The name to modify
name
,
long
The value
value
)

Set the name to value.

public int
size()

Returns the number of headers in this object.

Inherited from java.lang.Iterable:
forEachspliterator