public interface FlexibleCache<K, V>
extends EvictableCache
An EvictableCache supporting a getAndPut variant with additional control over caching.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public V |
getAndPut(K key, ValueProvider<? super K, ? extends V> valueProvider, boolean shouldCache)Returns the value associated with key, creating it with the
supplied provider when necessary and optionally caching the result. |
| Methods inherited from class | Name |
|---|---|
interface EvictableCache |
clear, clearAll, containsKey, keys, remove, size, values |
interface MemoizeCache |
cleanUpNullReferences, get, getAndPut, put |
Returns the value associated with key, creating it with the
supplied provider when necessary and optionally caching the result.
key - the key to look upvalueProvider - supplies a value when the key is not cachedshouldCache - whether a newly created value should be stored