
Package ca.uhn.fhir.rest.api.server
Class UserDataMap
java.lang.Object
ca.uhn.fhir.rest.api.server.UserDataMap
RequestDetails.getUserData() used a HashMap previously but that is not thread-safe. It's not
possible to simply replace HashMap with ConcurrentHashMap in RequestDetails since null
values work differently. This class is a thin wrapper around ConcurrentHashMap that
preserves the expected null value behaviour on get. Note that contains() and size() do
behave differently. See UserDataMapTest for details. We could use Collections.synchronizedMap to achieve
the required thread-safety, but ConcurrentHashMap has better performance characteristics.
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
UserDataMap
public UserDataMap()
-
-
Method Details
-
size
-
isEmpty
-
containsKey
- Specified by:
containsKey
in interfaceMap<Object,
Object>
-
containsValue
- Specified by:
containsValue
in interfaceMap<Object,
Object>
-
get
-
put
-
remove
-
clear
-
putAll
-
keySet
-
values
-
entrySet
-
equals
-
hashCode
-