Package io.undertow.util
Class CopyOnWriteMap<K,V>
java.lang.Object
io.undertow.util.CopyOnWriteMap<K,V>
- All Implemented Interfaces:
ConcurrentMap<K,,V> Map<K,V>
A basic copy on write map. It simply delegates to an underlying map, that is swapped out
every time the map is updated.
Note: this is not a secure map. It should not be used in situations where the map is populated
from user input.
- Author:
- Stuart Douglas
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanisEmpty()keySet()voidputIfAbsent(K key, V value) booleanremoveInternal(Object key) booleanintsize()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
-
Constructor Details
-
CopyOnWriteMap
public CopyOnWriteMap() -
CopyOnWriteMap
-
-
Method Details
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
putIfAbsentin interfaceMap<K,V>
-
remove
-
replace
-
replace
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
removeInternal
-