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, 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, Charset charset) Encode a username and password to be used in basic authorization.entrySet()booleaninthashCode()booleanisEmpty()keySet()voidvoidvoidvoidsetBasicAuth(String username, String password) intsize()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllMethods inherited from interface org.springframework.util.MultiValueMap
addIfAbsent, asSingleValueMap
-
Field Details
-
AUTHORIZATION
- See Also:
-
-
Constructor Details
-
HttpHeaders
public HttpHeaders()
-
-
Method Details
-
getFirst
- Specified by:
getFirstin interfaceMultiValueMap<String,String>
-
add
- Specified by:
addin interfaceMultiValueMap<String,String>
-
addAll
- Specified by:
addAllin interfaceMultiValueMap<String,String>
-
addAll
- Specified by:
addAllin interfaceMultiValueMap<String,String>
-
set
- Specified by:
setin interfaceMultiValueMap<String,String>
-
setAll
- Specified by:
setAllin interfaceMultiValueMap<String,String>
-
toSingleValueMap
- Specified by:
toSingleValueMapin interfaceMultiValueMap<String,String>
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,List<String>>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,List<String>>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int 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
-