Class ForwardingLoadingCache.SimpleForwardingLoadingCache<K,V>
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.cache.ForwardingCache<K,V>
com.google.common.cache.ForwardingLoadingCache<K,V>
com.google.common.cache.ForwardingLoadingCache.SimpleForwardingLoadingCache<K,V>
- All Implemented Interfaces:
Function<K,V>, Cache<K, V>, LoadingCache<K, V>
- Enclosing class:
ForwardingLoadingCache<K,V>
public abstract static class ForwardingLoadingCache.SimpleForwardingLoadingCache<K,V>
extends ForwardingLoadingCache<K,V>
A simplified version of
ForwardingLoadingCache where subclasses can pass in an already
constructed LoadingCache as the delegate.- Since:
- 10.0
- Author:
- Charles Fry
-
Nested Class Summary
Nested classes/interfaces inherited from class ForwardingLoadingCache
ForwardingLoadingCache.SimpleForwardingLoadingCache<K,V> Modifier and TypeClassDescriptionstatic classA simplified version ofForwardingLoadingCachewhere subclasses can pass in an already constructedLoadingCacheas the delegate.Nested classes/interfaces inherited from class ForwardingCache
ForwardingCache.SimpleForwardingCache<K,V> Modifier and TypeClassDescriptionstatic classA simplified version ofForwardingCachewhere subclasses can pass in an already constructedCacheas the delegate. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final LoadingCache<K, V> delegate()Returns the backing delegate instance that methods are forwarded to.Methods inherited from class ForwardingLoadingCache
apply, get, getAll, getUnchecked, refreshModifier and TypeMethodDescriptionReturns the result of applying this function toinput.Returns the value associated withkeyin this cache, first loading that value if necessary.Returns a map of the values associated withkeys, creating or retrieving those values if necessary.getUnchecked(K key) Returns the value associated withkeyin this cache, first loading that value if necessary.voidLoads a new value forkey, possibly asynchronously.Methods inherited from class ForwardingCache
asMap, cleanUp, get, getAllPresent, getIfPresent, invalidate, invalidateAll, invalidateAll, put, putAll, size, statsModifier and TypeMethodDescriptionasMap()Returns a view of the entries stored in this cache as a thread-safe map.voidcleanUp()Performs any pending maintenance operations needed by the cache.Returns the value associated withkeyin this cache, obtaining that value fromloaderif necessary.getAllPresent(Iterable<? extends Object> keys) Returns a map of the values associated withkeysin this cache.getIfPresent(Object key) Returns the value associated withkeyin this cache, ornullif there is no cached value forkey.voidinvalidate(Object key) Discards any cached value for keykey.voidDiscards all entries in the cache.voidinvalidateAll(Iterable<? extends Object> keys) Discards any cached values for keyskeys.voidAssociatesvaluewithkeyin this cache.voidCopies all of the mappings from the specified map to the cache.longsize()Returns the approximate number of entries in this cache.stats()Returns a current snapshot of this cache's cumulative statistics, or a set of default values if the cache is not recording statistics.Methods inherited from class ForwardingObject
toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface LoadingCache
asMapModifier and TypeMethodDescriptionasMap()Returns a view of the entries stored in this cache as a thread-safe map.
-
Constructor Details
-
SimpleForwardingLoadingCache
-
-
Method Details
-
delegate
Description copied from class:ForwardingObjectReturns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such asForwardingSet.delegate(). Concrete subclasses override this method to supply the instance being decorated.- Specified by:
delegatein classForwardingLoadingCache<K,V>
-