public interface HttpHeaders
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
allValues(java.lang.String name)
Returns an unmodifiable List of all of the values of the given named header.
|
java.util.Optional<java.lang.String> |
firstValue(java.lang.String name)
Returns an
Optional containing the first value of the
given named (and possibly multi-valued) header. |
java.util.Optional<java.lang.Long> |
firstValueAsLong(java.lang.String name)
Returns an
Optional containing the first value of the named header
field as an Optional<Long>. |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
map()
Returns an unmodifiable multi Map view of this HttpHeaders.
|
java.util.Optional<java.lang.String> firstValue(java.lang.String name)
Optional
containing the first value of the
given named (and possibly multi-valued) header. If the header is not
present, then the returned Optional
is empty.name
- the header nameOptional<String>
for the first named valuejava.util.Optional<java.lang.Long> firstValueAsLong(java.lang.String name)
Optional
containing the first value of the named header
field as an Optional<Long>. If the header is not present, then
the Optional is empty. If the header is present but contains a value that
does not parse as a Long
value, then an exception is thrown.name
- the header nameOptional<Long>
java.lang.NumberFormatException
- if a value is found, but does not parse as a Longjava.util.List<java.lang.String> allValues(java.lang.String name)
name
- the header namejava.util.Map<java.lang.String,java.util.List<java.lang.String>> map()