public class FluentCaseInsensitiveStringsMap extends Object implements Map<String,List<String>>, Iterable<Map.Entry<String,List<String>>>
String -> List<String>
map that adds a fluent interface, i.e. methods that
return this instance. This class differs from FluentStringsMap
in that keys are treated in an
case-insensitive matter, i.e. case of the key doesn't matter when retrieving values or changing the map.
However, the map preserves the key case (of the first insert or replace) and returns the keys in their
original case in the appropriate methods (e.g. keySet()
).Constructor and Description |
---|
FluentCaseInsensitiveStringsMap() |
FluentCaseInsensitiveStringsMap(FluentCaseInsensitiveStringsMap src) |
FluentCaseInsensitiveStringsMap(Map<String,Collection<String>> src) |
Modifier and Type | Method and Description |
---|---|
FluentCaseInsensitiveStringsMap |
add(String key,
Collection<String> values)
Adds the specified values and returns this object.
|
FluentCaseInsensitiveStringsMap |
add(String key,
String... values)
Adds the specified values and returns this object.
|
FluentCaseInsensitiveStringsMap |
add(String key,
String value) |
FluentCaseInsensitiveStringsMap |
addAll(FluentCaseInsensitiveStringsMap src)
Adds all key-values pairs from the given object to this object and returns this object.
|
FluentCaseInsensitiveStringsMap |
addAll(Map<String,Collection<String>> src)
Adds all key-values pairs from the given map to this object and returns this object.
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
FluentCaseInsensitiveStringsMap |
delete(String key)
Removes the values for the given key if present and returns this object.
|
FluentCaseInsensitiveStringsMap |
deleteAll(Collection<String> keys)
Removes the values for the given keys if present and returns this object.
|
FluentCaseInsensitiveStringsMap |
deleteAll(String... keys)
Removes the values for the given keys if present and returns this object.
|
Set<Map.Entry<String,List<String>>> |
entrySet() |
boolean |
equals(Object obj) |
List<String> |
get(Object key) |
String |
getFirstValue(String key)
Returns the value for the given key.
|
String |
getJoinedValue(String key,
String delimiter)
Returns the values for the given key joined into a single string using the given delimiter.
|
int |
hashCode() |
boolean |
isEmpty() |
Iterator<Map.Entry<String,List<String>>> |
iterator() |
Set<String> |
keySet() |
List<String> |
put(String key,
List<String> value) |
void |
putAll(Map<? extends String,? extends List<String>> values) |
List<String> |
remove(Object key) |
FluentCaseInsensitiveStringsMap |
replaceAll(FluentCaseInsensitiveStringsMap src)
Replace the values for all keys from the given map that are also present in this object, with the values from the given map.
|
FluentCaseInsensitiveStringsMap |
replaceAll(Map<? extends String,? extends Collection<String>> src)
Replace the values for all keys from the given map that are also present in this object, with the values from the given map.
|
FluentCaseInsensitiveStringsMap |
replaceWith(String key,
Collection<String> values)
Replaces the values for the given key with the given values.
|
FluentCaseInsensitiveStringsMap |
replaceWith(String key,
String... values)
Replaces the values for the given key with the given values.
|
int |
size() |
String |
toString() |
Collection<List<String>> |
values() |
public FluentCaseInsensitiveStringsMap()
public FluentCaseInsensitiveStringsMap(FluentCaseInsensitiveStringsMap src)
public FluentCaseInsensitiveStringsMap(Map<String,Collection<String>> src)
public FluentCaseInsensitiveStringsMap add(String key, String value)
public FluentCaseInsensitiveStringsMap add(String key, String... values)
key
- The keyvalues
- The value(s); if the array is null then this method has no effect. Individual null values are turned into empty stringspublic FluentCaseInsensitiveStringsMap add(String key, Collection<String> values)
key
- The keyvalues
- The value(s); if null then this method has no effect. Use an empty collection
to generate an empty valuepublic FluentCaseInsensitiveStringsMap addAll(FluentCaseInsensitiveStringsMap src)
src
- The source objectpublic FluentCaseInsensitiveStringsMap addAll(Map<String,Collection<String>> src)
src
- The source mappublic FluentCaseInsensitiveStringsMap replaceWith(String key, String... values)
key
- The keyvalues
- The new valuespublic FluentCaseInsensitiveStringsMap replaceWith(String key, Collection<String> values)
key
- The keyvalues
- The new valuespublic FluentCaseInsensitiveStringsMap replaceAll(FluentCaseInsensitiveStringsMap src)
src
- The source objectpublic FluentCaseInsensitiveStringsMap replaceAll(Map<? extends String,? extends Collection<String>> src)
src
- The source mappublic FluentCaseInsensitiveStringsMap delete(String key)
key
- The keypublic FluentCaseInsensitiveStringsMap deleteAll(String... keys)
keys
- The keyspublic FluentCaseInsensitiveStringsMap deleteAll(Collection<String> keys)
keys
- The keyspublic boolean containsKey(Object key)
containsKey
in interface Map<String,List<String>>
public boolean containsValue(Object value)
containsValue
in interface Map<String,List<String>>
public String getFirstValue(String key)
key
- The keypublic String getJoinedValue(String key, String delimiter)
key
- The keypublic Collection<List<String>> values()
public boolean equals(Object obj)
public int hashCode()
Copyright © 2014. All Rights Reserved.