Class TrackingMap<V>
- java.lang.Object
-
- org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
-
- org.jboss.resteasy.util.CaseInsensitiveMap<V>
-
- org.jboss.resteasy.client.jaxrs.internal.TrackingMap<V>
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,List<V>>,javax.ws.rs.core.MultivaluedMap<String,V>
public class TrackingMap<V> extends CaseInsensitiveMap<V> implements javax.ws.rs.core.MultivaluedMap<String,V>, Cloneable
A decorator class to track changes to the underlying map. Tracks the keys that are either added/replaced/modified in addedOrUpdatedKeys. Tracks the keys that are removed in removedKeys.Known Limitation: The get and getFirst methods returns the list(since this is an instance of MultivaluedMap) value of the given key. Any direct changes to the underlying list will not be tracked.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jboss.resteasy.util.CaseInsensitiveMap
CASE_INSENSITIVE_ORDER
-
-
Constructor Summary
Constructors Constructor Description TrackingMap(CaseInsensitiveMap<V> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String key, V value)voidaddAll(String key, List<V> valueList)voidaddAll(String key, V... newValues)voidaddFirst(String key, V value)voidclear()TrackingMap<V>clone()List<V>compute(String key, BiFunction<? super String,? super List<V>,? extends List<V>> remappingFunction)List<V>computeIfAbsent(String key, Function<? super String,? extends List<V>> mappingFunction)List<V>computeIfPresent(String key, BiFunction<? super String,? super List<V>,? extends List<V>> remappingFunction)booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<String,List<V>>>entrySet()booleanequals(Object o)booleanequalsIgnoreValueOrder(javax.ws.rs.core.MultivaluedMap<String,V> omap)voidforEach(BiConsumer<? super String,? super List<V>> action)List<V>get(Object key)Set<String>getAddedOrUpdatedKeys()VgetFirst(String key)List<V>getOrDefault(Object key, List<V> defaultValue)Set<String>getRemovedKeys()inthashCode()booleanisEmpty()Set<String>keySet()List<V>merge(String key, List<V> value, BiFunction<? super List<V>,? super List<V>,? extends List<V>> remappingFunction)List<V>put(String key, List<V> value)voidputAll(Map<? extends String,? extends List<V>> t)List<V>putIfAbsent(String key, List<V> value)voidputSingle(String key, V value)List<V>remove(Object key)booleanremove(Object key, Object value)List<V>replace(String key, List<V> value)booleanreplace(String key, List<V> oldValue, List<V> newValue)voidreplaceAll(BiFunction<? super String,? super List<V>,? extends List<V>> function)intsize()StringtoString()Collection<List<V>>values()-
Methods inherited from class org.jboss.resteasy.specimpl.MultivaluedTreeMap
addAll, clone, copy, toString
-
-
-
-
Constructor Detail
-
TrackingMap
public TrackingMap(CaseInsensitiveMap<V> delegate)
-
-
Method Detail
-
merge
public List<V> merge(String key, List<V> value, BiFunction<? super List<V>,? super List<V>,? extends List<V>> remappingFunction)
-
replaceAll
public void replaceAll(BiFunction<? super String,? super List<V>,? extends List<V>> function)
- Specified by:
replaceAllin interfaceMap<String,List<V>>
-
putIfAbsent
public List<V> putIfAbsent(String key, List<V> value)
- Specified by:
putIfAbsentin interfaceMap<String,List<V>>
-
computeIfAbsent
public List<V> computeIfAbsent(String key, Function<? super String,? extends List<V>> mappingFunction)
- Specified by:
computeIfAbsentin interfaceMap<String,List<V>>
-
computeIfPresent
public List<V> computeIfPresent(String key, BiFunction<? super String,? super List<V>,? extends List<V>> remappingFunction)
- Specified by:
computeIfPresentin interfaceMap<String,List<V>>
-
compute
public List<V> compute(String key, BiFunction<? super String,? super List<V>,? extends List<V>> remappingFunction)
-
clear
public void clear()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,List<V>>- Overrides:
containsKeyin classMultivaluedTreeMap<String,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<String,List<V>>- Overrides:
containsValuein classMultivaluedTreeMap<String,V>
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
values
public Collection<List<V>> values()
-
equalsIgnoreValueOrder
public boolean equalsIgnoreValueOrder(javax.ws.rs.core.MultivaluedMap<String,V> omap)
- Specified by:
equalsIgnoreValueOrderin interfacejavax.ws.rs.core.MultivaluedMap<String,V>- Overrides:
equalsIgnoreValueOrderin classMultivaluedTreeMap<String,V>
-
getOrDefault
public List<V> getOrDefault(Object key, List<V> defaultValue)
- Specified by:
getOrDefaultin interfaceMap<String,List<V>>
-
forEach
public void forEach(BiConsumer<? super String,? super List<V>> action)
-
toString
public String toString()
- Overrides:
toStringin classMultivaluedTreeMap<String,V>
-
clone
public TrackingMap<V> clone()
- Overrides:
clonein classMultivaluedTreeMap<String,V>
-
-