public final class LoadingCacheUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <K,V> V |
getCacheValue(com.google.common.cache.LoadingCache<K,V> cache,
K key)
Get the cache value for the given key.
|
static <T,K,V> T |
getCastCacheValue(com.google.common.cache.LoadingCache<K,V> cache,
Object key)
Get and cast the cache value for the given key.
|
public static <K,V> V getCacheValue(com.google.common.cache.LoadingCache<K,V> cache, K key)
K
- Key typeV
- Value typecache
- key
- com.google.common.util.concurrent.ExecutionError
- if an error is thrown while loading the valuepublic static <T,K,V> T getCastCacheValue(com.google.common.cache.LoadingCache<K,V> cache, Object key)
T
- Required typeK
- Key typeV
- Value typecache
- key
- com.google.common.util.concurrent.ExecutionError
- if an error is thrown while loading the valueCopyright © 2016. All rights reserved.