Package org.zalando.logbook
Interface HttpHeaders
-
@Immutable public interface HttpHeaders extends Map<String,List<String>>
An immutable multi-map representing HTTP headers. It offers three kinds of operations:update
is essentiallyMap.put(Object, Object)
, but returns a new instance with the updated entries.delete
is essentiallyMap.remove(Object)
, but returns a new instance without the deleted headers.apply
applies a function to all entries or a subset of them and applies the changes. If the given operator returns a null value the entry will be deleted otherwise updated.
-
-
Method Summary
-
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, size, values
-
-
-
-
Method Detail
-
update
@CheckReturnValue HttpHeaders update(String name, String... values)
-
update
@CheckReturnValue HttpHeaders update(String name, Collection<String> value)
-
update
@CheckReturnValue HttpHeaders update(Map<String,List<String>> headers)
-
apply
@CheckReturnValue HttpHeaders apply(String name, UnaryOperator<List<String>> operator)
-
apply
@CheckReturnValue HttpHeaders apply(Collection<String> names, BiFunction<String,List<String>,Collection<String>> operator)
-
apply
@CheckReturnValue HttpHeaders apply(BiPredicate<String,List<String>> predicate, BiFunction<String,List<String>,Collection<String>> operator)
-
apply
@CheckReturnValue HttpHeaders apply(BiFunction<String,List<String>,Collection<String>> operator)
-
delete
@CheckReturnValue HttpHeaders delete(String... names)
-
delete
@CheckReturnValue HttpHeaders delete(Collection<String> names)
-
delete
@CheckReturnValue HttpHeaders delete(BiPredicate<String,List<String>> predicate)
-
empty
static HttpHeaders empty()
-
of
static HttpHeaders of(String name, String... values)
-
of
static HttpHeaders of(Map<String,List<String>> headers)
-
predicate
static <T,U> BiPredicate<T,U> predicate(Predicate<T> predicate)
-
remove
@Deprecated List<String> remove(Object key)
Deprecated.
-
putAll
@Deprecated void putAll(Map<? extends String,? extends List<String>> m)
Deprecated.
-
clear
@Deprecated void clear()
Deprecated.
-
replaceAll
@Deprecated void replaceAll(BiFunction<? super String,? super List<String>,? extends List<String>> function)
Deprecated.- Specified by:
replaceAll
in interfaceMap<String,List<String>>
-
putIfAbsent
@Deprecated List<String> putIfAbsent(String key, List<String> value)
Deprecated.- Specified by:
putIfAbsent
in interfaceMap<String,List<String>>
-
remove
@Deprecated boolean remove(Object key, Object value)
Deprecated.
-
replace
@Deprecated boolean replace(String key, List<String> oldValue, List<String> newValue)
Deprecated.
-
computeIfAbsent
@Deprecated List<String> computeIfAbsent(String key, Function<? super String,? extends List<String>> mappingFunction)
Deprecated.- Specified by:
computeIfAbsent
in interfaceMap<String,List<String>>
-
computeIfPresent
@Deprecated List<String> computeIfPresent(String key, BiFunction<? super String,? super List<String>,? extends List<String>> remappingFunction)
Deprecated.- Specified by:
computeIfPresent
in interfaceMap<String,List<String>>
-
compute
@Deprecated List<String> compute(String key, BiFunction<? super String,? super List<String>,? extends List<String>> remappingFunction)
Deprecated.
-
-