K - Cache key typeV - Cache value type. (Optional<V>)public class AbsentInvalidatingLoadingCache<K,V>
extends com.google.common.cache.ForwardingLoadingCache.SimpleForwardingLoadingCache<K,com.google.common.base.Optional<V>>
When the LoadingCache returned Absent, this implementation will invalidate the entry immediately to avoid caching negative hits.
| Constructor and Description |
|---|
AbsentInvalidatingLoadingCache(com.google.common.cache.LoadingCache<K,com.google.common.base.Optional<V>> delegate)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.common.base.Optional<V> |
apply(K key) |
com.google.common.base.Optional<V> |
get(K key) |
com.google.common.base.Optional<V> |
get(K key,
Callable<? extends com.google.common.base.Optional<V>> valueLoader) |
com.google.common.base.Optional<V> |
getIfPresent(Object key) |
com.google.common.base.Optional<V> |
getUnchecked(K key) |
delegateasMap, cleanUp, getAllPresent, invalidate, invalidateAll, invalidateAll, put, putAll, size, statsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic com.google.common.base.Optional<V> get(K key) throws ExecutionException
get in interface com.google.common.cache.LoadingCache<K,com.google.common.base.Optional<V>>get in class com.google.common.cache.ForwardingLoadingCache<K,com.google.common.base.Optional<V>>ExecutionExceptionpublic com.google.common.base.Optional<V> apply(K key)
apply in interface com.google.common.base.Function<K,com.google.common.base.Optional<V>>apply in interface com.google.common.cache.LoadingCache<K,com.google.common.base.Optional<V>>apply in class com.google.common.cache.ForwardingLoadingCache<K,com.google.common.base.Optional<V>>public com.google.common.base.Optional<V> get(K key, Callable<? extends com.google.common.base.Optional<V>> valueLoader) throws ExecutionException
get in interface com.google.common.cache.Cache<K,com.google.common.base.Optional<V>>get in class com.google.common.cache.ForwardingCache<K,com.google.common.base.Optional<V>>ExecutionExceptionCopyright © 2014. All rights reserved.