public interface Headers
Modifier and Type | Method and Description |
---|---|
MultiValueMap<String,String> |
asMultiValueMap() |
boolean |
contains(CharSequence name)
Checks whether a header has been specified for the given value.
|
boolean |
contains(String name)
Checks whether a header has been specified for the given value.
|
String |
get(CharSequence name)
Returns the header value with the specified header name.
|
String |
get(String name)
Returns the header value with the specified header name.
|
List<String> |
getAll(CharSequence name)
Returns all of the header values with the specified header name.
|
List<String> |
getAll(String name)
Returns all of the header values with the specified header name.
|
Date |
getDate(CharSequence name)
Returns the header value as a date with the specified header name.
|
Date |
getDate(String name)
Returns the header value as a date with the specified header name.
|
default Instant |
getInstant(CharSequence name)
Returns the header value as an instant with the specified header name.
|
Set<String> |
getNames()
All header names.
|
HttpHeaders |
getNettyHeaders()
Returns the headers in their Netty compliant form.
|
@Nullable String get(CharSequence name)
If there is more than one header value for the specified header name, the first value is returned.
name
- The case insensitive name of the header to get retrieve the first value ofnull
if there is no such header@Nullable String get(String name)
If there is more than one header value for the specified header name, the first value is returned.
name
- The case insensitive name of the header to get retrieve the first value ofnull
if there is no such header@Nullable Date getDate(CharSequence name)
If there is more than one header value for the specified header name, the first value is returned.
name
- The case insensitive name of the header to get retrieve the first value ofnull
if there is no such header or the header value is not a valid date format@Nullable default Instant getInstant(CharSequence name)
If there is more than one header value for the specified header name, the first value is returned.
name
- the case insensitive name of the header to get retrieve the first value ofnull
if there is no such header or the header value is not a valid date format@Nullable Date getDate(String name)
If there is more than one header value for the specified header name, the first value is returned.
name
- The case insensitive name of the header to get retrieve the first value ofnull
if there is no such header or the header value is not a valid date formatList<String> getAll(CharSequence name)
name
- The case insensitive name of the header to retrieve all of the values ofList
of header values, or an empty list if there is no such headerList<String> getAll(String name)
name
- The case insensitive name of the header to retrieve all of the values ofList
of header values, or an empty list if there is no such headerboolean contains(CharSequence name)
name
- The name of the header to check the existence ofboolean contains(String name)
name
- The name of the header to check the existence ofHttpHeaders getNettyHeaders()
Use of this method should be avoided, in favor of using the other methods of this interface.
MultiValueMap<String,String> asMultiValueMap()