Constructor and Description |
---|
StringListMap() |
Modifier and Type | Method and Description |
---|---|
StringListMap |
add(String key,
String value)
Adds the given value to the list of the given key.
|
StringListMap |
addToSet(String key,
String value)
Adds the given value to the list of the given key.
|
StringListMap |
clear(String key)
Clears the list for the given key.
|
boolean |
contains(String key,
String value)
Determines if the list stored for key contains the given value.
|
protected List<String> |
copyValue(List<String> value)
Creates a copy of the given value.
|
List<String> |
getList(String key)
Returns the list associated with the given key.
|
StringListMap |
remove(String key,
String value)
Removes the given value from the given list.
|
protected boolean |
valueNeedsCopy()
Determines if values in this map must be copied if the map is copied.
|
public List<String> getList(String key)
key
- the key to lookuppublic StringListMap add(String key, String value)
key
- the key used to determine the target listvalue
- the value to addpublic StringListMap addToSet(String key, String value)
Note that the list is treated like a set, therefore, if the value is already in the list, it won't be added again.
key
- the key used to determine the target listvalue
- the value to addpublic StringListMap remove(String key, String value)
key
- the key used to determine the list to remove the value fromvalue
- the value to removepublic boolean contains(String key, String value)
key
- the key used to determine the list to checkvalue
- the value to search forpublic StringListMap clear(String key)
key
- the key used to determine which list to clearprotected boolean valueNeedsCopy()
SafeMap
valueNeedsCopy
in class SafeMap<String,List<String>>
Copyright © 2018. All rights reserved.