Class HttpHeaders
java.lang.Object
org.springframework.data.elasticsearch.support.HttpHeaders
A simple class implementing HTTP headers as a MultiValueMap. This own implementation is necessary to remove the
dependency to the class with the same name from org.springframework:spring-web. Under the hood is uses a
LinkedCaseInsensitiveMap.- Since:
- 5.0
- Author:
- Peter-Josef Meisch
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddAll(MultiValueMap<String, @Nullable String> values) voidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) static StringencodeBasicAuth(String username, String password) Encode a username and password to be used in basic authorization.static StringencodeBasicAuth(String username, String password, @Nullable Charset charset) Encode a username and password to be used in basic authorization.entrySet()boolean@Nullable StringinthashCode()booleanisEmpty()keySet()voidvoidvoidvoidsetBasicAuth(String username, String password) intsize()values()Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllMethods inherited from interface MultiValueMap
addIfAbsent, asSingleValueMap
-
Field Details
-
AUTHORIZATION
- See Also:
-
-
Constructor Details
-
HttpHeaders
public HttpHeaders()
-
-
Method Details
-
getFirst
-
add
-
addAll
-
addAll
- Specified by:
addAllin interfaceMultiValueMap<String, @Nullable String>
-
set
-
setAll
-
toSingleValueMap
- Specified by:
toSingleValueMapin interfaceMultiValueMap<String, @Nullable String>
-
size
-
isEmpty
-
containsKey
-
containsValue
-
get
-
put
-
remove
-
putAll
-
clear
-
keySet
-
values
-
entrySet
-
equals
-
hashCode
-
setBasicAuth
-
encodeBasicAuth
Encode a username and password to be used in basic authorization. Code copied from the spring-web HttpHeaders class.- Parameters:
username- the username, must not contain a colonpassword- the password- Returns:
- the encoded value
-
encodeBasicAuth
Encode a username and password to be used in basic authorization. Code copied from the spring-web HttpHeaders class.- Parameters:
username- the username, must not contain a colonpassword- the passwordcharset- charset for the encoding, if null StandardCharsets.ISO_8859_1 is used- Returns:
- the encoded value
-