- All Superinterfaces:
Snapshottable<LookupCache<K,
V>>
- All Known Implementing Classes:
SimpleLookupCache
An interface describing the required API for the Jackson-Databind Type cache.
Note that while interface itself does not specify synchronization requirements for implementations, specific use cases do. Typically implementations are expected to be thread-safe, that is, to handle synchronization.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Method for removing all contents this cache has.default void
contents
(BiConsumer<K, V> consumer) Method to apply operation on cache contents without exposing them.Method needed for creating clones but without contents.putIfAbsent
(K key, V value) int
size()
Methods inherited from interface tools.jackson.core.util.Snapshottable
snapshot
-
Method Details
-
contents
Method to apply operation on cache contents without exposing them.Default implementation throws
UnsupportedOperationException
. Implementations are required to override this method.- Parameters:
consumer
- Operation to apply on cache contents.- Throws:
UnsupportedOperationException
- if implementation does not override this method.
-
emptyCopy
LookupCache<K,V> emptyCopy()Method needed for creating clones but without contents. -
size
int size()- Returns:
- Number of entries currently in cache: may be approximate, only to be used for diagnostics, metrics reporting
-
get
- Parameters:
key
-- Returns:
- value associated with key (can return null)
-
put
-
putIfAbsent
-
clear
void clear()Method for removing all contents this cache has.
-