public final class LoadingCacheUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <K,V> V |
getCacheValue(LoadingCache<K,V> cache,
K key)
Get the cache value for the given key.
|
static <T,K,V> T |
getCastCacheValue(LoadingCache<K,V> cache,
Object key)
Get and cast the cache value for the given key.
|
public static <K,V> V getCacheValue(LoadingCache<K,V> cache, K key)
ExecutionException
and UncheckedExecutionException
.K
- Key typeV
- Value typecache
- key
- wrapExecutionProblem
- If true
, wrap possible ExecutionException
and
UncheckedExecutionException
, otherwise UncheckedExecutionException
may be thrown when execution
problem occursExecutionError
- if an error is thrown while loading the valuepublic static <T,K,V> T getCastCacheValue(LoadingCache<K,V> cache, Object key)
T
- Required typeK
- Key typeV
- Value typecache
- key
- wrapExecutionProblem
- If true
, wrap possible ExecutionException
and
UncheckedExecutionException
, otherwise UncheckedExecutionException
may be thrown when execution
problem occursExecutionError
- if an error is thrown while loading the valueCopyright © 2013 Seam Framework. All Rights Reserved.