public class LoadingCache<K,KK,V> extends Object
| Modifier and Type | Field | Description |
|---|---|---|
static Function |
IDENTITY |
|
protected Function<K,KK> |
keyMapper |
|
protected Function<K,V> |
loader |
|
protected ConcurrentMap<KK,Object> |
map |
| Constructor | Description |
|---|---|
LoadingCache(Function<K,KK> keyMapper,
Function<K,V> loader) |
| Modifier and Type | Method | Description |
|---|---|---|
protected V |
createEntry(K key,
KK cacheKey,
Object v) |
Loads entry to the cache.
|
V |
get(K key) |
|
static <K> Function<K,K> |
identity() |
protected final ConcurrentMap<KK,Object> map
public static final Function IDENTITY
public static <K> Function<K,K> identity()
protected V createEntry(K key, KK cacheKey, 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 FutureTaskCopyright © 2018. All rights reserved.