Package ratpack.core.http
Interface MutableHeaders
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MutableHeaders
add(CharSequence name, 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(CharSequence name)
Removes the header with the specified name.MutableHeaders
set(CharSequence name, Iterable<?> values)
Sets a new header with the specified name and values.MutableHeaders
set(CharSequence name, Object value)
Sets the (only) value for the header with the specified name.default MutableHeaders
setDate(CharSequence name, Instant value)
Set a header with the given date as the value.MutableHeaders
setDate(CharSequence name, Date value)
Set a header with the given date as the value.-
Methods inherited from interface ratpack.core.http.Headers
asMultiValueMap, contains, contains, get, get, getAll, getAll, getDate, getDate, getInstant, getNames, getNettyHeaders
-
-
-
-
Method Detail
-
add
MutableHeaders add(CharSequence name, Object value)
Adds a new header with the specified name and value.Will not replace any existing values for the header.
Objects of type
Instant
,Calendar
orDate
will be converted to a RFC 7231 date/time string.- Parameters:
name
- The name of the headervalue
- The value of the header- Returns:
- this
-
set
MutableHeaders set(CharSequence name, Object value)
Sets the (only) value for the header with the specified name.All existing values for the same header will be removed.
Objects of type
Instant
,Calendar
orDate
will be converted to a RFC 7231 date/time string.- Parameters:
name
- The name of the headervalue
- The value of the header- Returns:
- this
-
setDate
MutableHeaders setDate(CharSequence name, Date value)
Set a header with the given date as the value.- Parameters:
name
- The name of the headervalue
- The date value- Returns:
- this
-
setDate
default MutableHeaders setDate(CharSequence name, Instant value)
Set a header with the given date as the value.- Parameters:
name
- the name of the headervalue
- the date value- Returns:
- this
- Since:
- 1.4
-
set
MutableHeaders set(CharSequence name, Iterable<?> values)
Sets a new header with the specified name and values.All existing values for the same header will be removed.
Objects of type
Instant
,Calendar
orDate
will be converted to a RFC 7231 date/time string.- Parameters:
name
- The name of the headervalues
- The values of the header- Returns:
- this
-
remove
MutableHeaders remove(CharSequence name)
Removes the header with the specified name.- Parameters:
name
- The name of the header to remove.- Returns:
- this
-
clear
MutableHeaders clear()
Removes all headers from this message.- Returns:
- this
-
copy
MutableHeaders copy(Headers headers)
-
-