V
- The value type of the wrapped MultivaluedMap
.public class GuardianStringKeyMultivaluedMap<V> extends Object implements MultivaluedMap<String,V>
MultivaluedMap
wrapper that is able to set guards observing changes of values represented by a key.Constructor and Description |
---|
GuardianStringKeyMultivaluedMap(MultivaluedMap<String,V> inner) |
Modifier and Type | Method and Description |
---|---|
void |
add(String key,
V value)
Add a value to the current list of values for the supplied key.
|
void |
addAll(String key,
List<V> valueList)
Add all the values from the supplied value list to the current list of values for the supplied key.
|
void |
addAll(String key,
V... newValues)
Add multiple values to the current list of values for the supplied key.
|
void |
addFirst(String key,
V value)
Add a value to the first position in the current list of values for the supplied key.
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,List<V>>> |
entrySet() |
boolean |
equals(Object o) |
boolean |
equalsIgnoreValueOrder(MultivaluedMap<String,V> otherMap)
Compare the specified map with this map for equality modulo the order of values for each key.
|
List<V> |
get(Object key) |
V |
getFirst(String key)
A shortcut to get the first value of the supplied key.
|
Set<String> |
getGuards()
Get all the guarded keys
|
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isObservedAndReset(String key)
Return true when the value represented by the key has changed.
|
Set<String> |
keySet() |
List<V> |
put(String key,
List<V> value) |
void |
putAll(Map<? extends String,? extends List<V>> m) |
void |
putSingle(String key,
V value)
Set the key's value to be a one item list consisting of the supplied value.
|
List<V> |
remove(Object key) |
void |
setGuard(String key)
Observe changes of a value represented by the key.
|
int |
size() |
String |
toString() |
Collection<List<V>> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public GuardianStringKeyMultivaluedMap(MultivaluedMap<String,V> inner)
public void putSingle(String key, V value)
MultivaluedMap
putSingle
in interface MultivaluedMap<String,V>
key
- the keyvalue
- the single value of the keypublic void add(String key, V value)
MultivaluedMap
add
in interface MultivaluedMap<String,V>
key
- the keyvalue
- the value to be added.public V getFirst(String key)
MultivaluedMap
getFirst
in interface MultivaluedMap<String,V>
key
- the keypublic void addAll(String key, V... newValues)
MultivaluedMap
NullPointerException
if the supplied array of values is
null
.addAll
in interface MultivaluedMap<String,V>
key
- the key.newValues
- the values to be added.public void addAll(String key, List<V> valueList)
MultivaluedMap
NullPointerException
if the supplied array
of values is null
.addAll
in interface MultivaluedMap<String,V>
key
- the key.valueList
- the list of values to be added.public void addFirst(String key, V value)
MultivaluedMap
addFirst
in interface MultivaluedMap<String,V>
key
- the keyvalue
- the value to be added.public boolean equalsIgnoreValueOrder(MultivaluedMap<String,V> otherMap)
MultivaluedMap
equalsIgnoreValueOrder
in interface MultivaluedMap<String,V>
otherMap
- map to be compared to this one.public boolean containsKey(Object key)
containsKey
in interface Map<String,List<V>>
public boolean containsValue(Object value)
containsValue
in interface Map<String,List<V>>
public void setGuard(String key)
key
- the key values to observepublic boolean isObservedAndReset(String key)
key
- the Key observed.public boolean equals(Object o)
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.