public class LoadingCache<K,KK,V>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Function |
IDENTITY |
protected Function<K,KK> |
keyMapper |
protected Function<K,V> |
loader |
protected java.util.concurrent.ConcurrentMap<KK,java.lang.Object> |
map |
Constructor and Description |
---|
LoadingCache(Function<K,KK> keyMapper,
Function<K,V> loader) |
Modifier and Type | Method and Description |
---|---|
protected V |
createEntry(K key,
KK cacheKey,
java.lang.Object v)
Loads entry to the cache.
|
V |
get(K key) |
static <K> Function<K,K> |
identity() |
protected final java.util.concurrent.ConcurrentMap<KK,java.lang.Object> map
public static final Function IDENTITY
public static <K> Function<K,K> identity()
protected V createEntry(K key, KK cacheKey, java.lang.Object v)
FutureTask
first so other competing thread might wait for the result.key
- original key that would be used to load the instancecacheKey
- key that would be used to store the entry in internal mapv
- null or FutureTask