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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
addAll
(MultiValueMap<String, String> values) void
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) static String
encodeBasicAuth
(String username, String password) Encode a username and password to be used in basic authorization.static String
encodeBasicAuth
(String username, String password, Charset charset) Encode a username and password to be used in basic authorization.entrySet()
boolean
int
hashCode()
boolean
isEmpty()
keySet()
void
void
void
void
setBasicAuth
(String username, String password) int
size()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
Methods inherited from interface org.springframework.util.MultiValueMap
addIfAbsent
-
Field Details
-
AUTHORIZATION
- See Also:
-
-
Constructor Details
-
HttpHeaders
public HttpHeaders()
-
-
Method Details
-
getFirst
- Specified by:
getFirst
in interfaceMultiValueMap<String,
String>
-
add
- Specified by:
add
in interfaceMultiValueMap<String,
String>
-
addAll
- Specified by:
addAll
in interfaceMultiValueMap<String,
String>
-
addAll
- Specified by:
addAll
in interfaceMultiValueMap<String,
String>
-
set
- Specified by:
set
in interfaceMultiValueMap<String,
String>
-
setAll
- Specified by:
setAll
in interfaceMultiValueMap<String,
String>
-
toSingleValueMap
- Specified by:
toSingleValueMap
in interfaceMultiValueMap<String,
String>
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<String,
List<String>>
-
containsValue
- Specified by:
containsValue
in 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
-