public class CacheUtils
extends java.lang.Object
Cache.| Modifier and Type | Method and Description |
|---|---|
static <K,V> V |
getAndUnwrap(com.google.common.cache.Cache<K,V> cache,
K key,
java.util.concurrent.Callable<? extends V> loader)
Same as
Cache.get(Object, Callable) but in case of exceptions unwraps the ExecutionException layer. |
public static <K,V> V getAndUnwrap(com.google.common.cache.Cache<K,V> cache,
K key,
java.util.concurrent.Callable<? extends V> loader)
Cache.get(Object, Callable) but in case of exceptions unwraps the ExecutionException layer.
This is useful if the loader can throw "special" exceptions like ProcessCanceledException in the IDE.