Top Description Methods
tools.jackson.databind.util

public Interface LookupCache<K, V>

extends Snapshottable<LookupCache<K, V>>
Known Direct Implementers
tools.jackson.databind.util.SimpleLookupCache
Imports
java.util.function.BiConsumer, tools.jackson.core.util.Snapshottable

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.

See Also
tools.jackson.databind.type.TypeFactory#withCache, SimpleLookupCache

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Method for removing all contents this cache has.

public default void
contents(BiConsumer<K, V>
Operation to apply on cache contents.
consumer
)

Method to apply operation on cache contents without exposing them.

public LookupCache<K, V>
emptyCopy()

Method needed for creating clones but without contents.

public V

Returns:

value associated with key (can return null)
get
(K key)

public V
put(K key, V value)

public V
putIfAbsent(K key, V value)

public int

Returns:

Number of entries currently in cache: may be approximate, only to be used for diagnostics, metrics reporting
size
()

Inherited from tools.jackson.core.util.Snapshottable:
snapshottakeSnapshot

Method Detail

clearback to summary
public void clear()

Method for removing all contents this cache has.

contentsback to summary
public default void contents(BiConsumer<K, V> consumer)

Method to apply operation on cache contents without exposing them.

Default implementation throws UnsupportedOperationException. Implementations are required to override this method.

Parameters
consumer:BiConsumer<K, V>

Operation to apply on cache contents.

Exceptions
UnsupportedOperationException:
if implementation does not override this method.
emptyCopyback to summary
public LookupCache<K, V> emptyCopy()

Method needed for creating clones but without contents.

getback to summary
public V get(K key)
Returns:V

value associated with key (can return null)

putback to summary
public V put(K key, V value)
putIfAbsentback to summary
public V putIfAbsent(K key, V value)
sizeback to summary
public int size()
Returns:int

Number of entries currently in cache: may be approximate, only to be used for diagnostics, metrics reporting