Constructor and Description |
---|
Headers() |
Modifier and Type | Method and Description |
---|---|
void |
add(String key,
List<String> values)
Adds the given values to the entry of the specified key.
|
void |
add(String key,
String value)
Adds the given value to the entry of the specified key.
|
void |
addAll(Map<? extends String,? extends List<String>> values)
Adds all the entries of the given map to this.
|
void |
clear() |
boolean |
contains(String key,
String value)
Convenience method for checking whether or not a named header contains a specific value.
|
boolean |
containsIgnoreCase(String key,
String value)
Convenience method for checking whether or not a named header contains a specific value, regardless of case.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
List<Map.Entry<String,String>> |
entries()
Returns an unmodifiable list of all key-value pairs of this.
|
Set<Map.Entry<String,List<String>>> |
entrySet() |
boolean |
equals(Object obj) |
List<String> |
get(Object key) |
String |
getFirst(String key)
Convenience method for retrieving the first value of a named header field.
|
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isTrue(String key)
Convenience method for checking whether or not a named header field is true.
|
Set<String> |
keySet() |
List<String> |
put(String key,
List<String> value) |
List<String> |
put(String key,
String value)
Convenience method to call
put(String, List) with a singleton list that contains the specified
value. |
void |
putAll(Map<? extends String,? extends List<String>> m) |
List<String> |
remove(Object key) |
boolean |
remove(String key,
String value)
Removes the given value from the entry of the specified key.
|
int |
size() |
String |
toString() |
Collection<List<String>> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public boolean containsKey(Object key)
containsKey
in interface Map<String,List<String>>
public boolean containsValue(Object value)
containsValue
in interface Map<String,List<String>>
public Collection<List<String>> values()
public boolean equals(Object obj)
public int hashCode()
public boolean contains(String key, String value)
Convenience method for checking whether or not a named header contains a specific value. If the named header is not set, or if the given value is not contained within that header's value list, this method returns false.
NOTE: This method is case-SENSITIVE.
key
- The key whose values to search in.value
- The values to search for.containsIgnoreCase(java.lang.String, java.lang.String)
public boolean containsIgnoreCase(String key, String value)
Convenience method for checking whether or not a named header contains a specific value, regardless of case. If the named header is not set, or if the given value is not contained within that header's value list, this method returns false.
NOTE: This method is case-INSENSITIVE.
key
- The key whose values to search in.value
- The values to search for, ignoring case.contains(java.lang.String, java.lang.String)
public void add(String key, String value)
Adds the given value to the entry of the specified key. If no entry exists for the given key, a new one is created containing only the given value.
key
- The key with which the specified value is to be associated.value
- The value to be added to the list associated with the specified key.public void add(String key, List<String> values)
Adds the given values to the entry of the specified key. If no entry exists for the given key, a new one is created containing only the given values.
key
- The key with which the specified value is to be associated.values
- The values to be added to the list associated with the specified key.public void addAll(Map<? extends String,? extends List<String>> values)
Adds all the entries of the given map to this. This is the same as calling add(String, List)
for each
entry in values.
values
- The values to be added to this.public List<String> put(String key, String value)
Convenience method to call put(String, List)
with a singleton list that contains the specified
value.
key
- The key of the entry to put.value
- The value to put.public boolean remove(String key, String value)
Removes the given value from the entry of the specified key.
key
- The key of the entry to remove from.value
- The value to remove from the entry.public String getFirst(String key)
Convenience method for retrieving the first value of a named header field. If the header is not set, or if the value list is empty, this method returns null.
key
- The key whose first value to return.public boolean isTrue(String key)
Convenience method for checking whether or not a named header field is true. To satisfy this, the header field needs to have at least 1 entry, and Boolean.valueOf() of all its values must parse as true.
key
- The key whose values to parse as a boolean.Copyright © 2018. All rights reserved.