public interface LookupCache<K,V>
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.
Modifier and Type | Method and Description |
---|---|
void |
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.
|
default LookupCache<K,V> |
emptyCopy()
Method needed for creating clones but without contents.
|
V |
get(Object key)
NOTE: key is of type Object only to retain binary backwards-compatibility
|
V |
put(K key,
V value) |
V |
putIfAbsent(K key,
V value) |
int |
size() |
default void contents(BiConsumer<K,V> consumer)
Default implementation throws UnsupportedOperationException
.
Implementations are required to override this method.
consumer
- Operation to apply on cache contents.UnsupportedOperationException
- if implementation does not override this method.default LookupCache<K,V> emptyCopy()
Default implementation throws UnsupportedOperationException
.
Implementations are required to override this method.
UnsupportedOperationException
- if implementation does not override this method.int size()
V get(Object key)
void clear()
Copyright © 2008–2024 FasterXML. All rights reserved.