public interface Headers
Modifier and Type | Method and Description |
---|---|
MultiValueMap<java.lang.String,java.lang.String> |
asMultiValueMap() |
boolean |
contains(java.lang.CharSequence name)
Checks whether a header has been specified for the given value.
|
boolean |
contains(java.lang.String name)
Checks whether a header has been specified for the given value.
|
java.lang.String |
get(java.lang.CharSequence name)
Returns the header value with the specified header name.
|
java.lang.String |
get(java.lang.String name)
Returns the header value with the specified header name.
|
java.util.List<java.lang.String> |
getAll(java.lang.CharSequence name)
Returns all of the header values with the specified header name.
|
java.util.List<java.lang.String> |
getAll(java.lang.String name)
Returns all of the header values with the specified header name.
|
java.util.Date |
getDate(java.lang.CharSequence name)
Returns the header value as a date with the specified header name.
|
java.util.Date |
getDate(java.lang.String name)
Returns the header value as a date with the specified header name.
|
default java.time.Instant |
getInstant(java.lang.CharSequence name)
Returns the header value as an instant with the specified header name.
|
java.util.Set<java.lang.String> |
getNames()
All header names.
|
HttpHeaders |
getNettyHeaders()
Returns the headers in their Netty compliant form.
|
@Nullable java.lang.String get(java.lang.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 java.lang.String get(java.lang.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 java.util.Date getDate(java.lang.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 java.time.Instant getInstant(java.lang.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 java.util.Date getDate(java.lang.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 formatjava.util.List<java.lang.String> getAll(java.lang.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 headerjava.util.List<java.lang.String> getAll(java.lang.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(java.lang.CharSequence name)
name
- The name of the header to check the existence ofboolean contains(java.lang.String name)
name
- The name of the header to check the existence ofjava.util.Set<java.lang.String> getNames()
HttpHeaders getNettyHeaders()
Use of this method should be avoided, in favor of using the other methods of this interface.
MultiValueMap<java.lang.String,java.lang.String> asMultiValueMap()