Modifier and Type | Method and Description |
---|---|
MutableHeaders |
add(java.lang.CharSequence name,
java.lang.Object value)
Adds a new header with the specified name and value.
|
MutableHeaders |
clear()
Removes all headers from this message.
|
MutableHeaders |
copy(Headers headers) |
MutableHeaders |
remove(java.lang.CharSequence name)
Removes the header with the specified name.
|
MutableHeaders |
set(java.lang.CharSequence name,
java.lang.Iterable<?> values)
Sets a new header with the specified name and values.
|
MutableHeaders |
set(java.lang.CharSequence name,
java.lang.Object value)
Sets the (only) value for the header with the specified name.
|
MutableHeaders |
setDate(java.lang.CharSequence name,
java.util.Date value)
Set a header with the given date as the value.
|
default MutableHeaders |
setDate(java.lang.CharSequence name,
java.time.Instant value)
Set a header with the given date as the value.
|
asMultiValueMap, contains, contains, get, get, getAll, getAll, getDate, getDate, getInstant, getNames, getNettyHeaders
MutableHeaders add(java.lang.CharSequence name, java.lang.Object value)
Will not replace any existing values for the header.
Objects of type Instant
, Calendar
or Date
will be converted to a
RFC 7231 date/time string.
name
- The name of the headervalue
- The value of the headerMutableHeaders set(java.lang.CharSequence name, java.lang.Object value)
All existing values for the same header will be removed.
Objects of type Instant
, Calendar
or Date
will be converted to a
RFC 7231 date/time string.
name
- The name of the headervalue
- The value of the headerMutableHeaders setDate(java.lang.CharSequence name, java.util.Date value)
name
- The name of the headervalue
- The date valuedefault MutableHeaders setDate(java.lang.CharSequence name, java.time.Instant value)
name
- the name of the headervalue
- the date valueMutableHeaders set(java.lang.CharSequence name, java.lang.Iterable<?> values)
All existing values for the same header will be removed.
Objects of type Instant
, Calendar
or Date
will be converted to a
RFC 7231 date/time string.
name
- The name of the headervalues
- The values of the headerMutableHeaders remove(java.lang.CharSequence name)
name
- The name of the header to remove.MutableHeaders clear()
MutableHeaders copy(Headers headers)