Class CaffeinatedGuavaLoadingCache.SingleLoader<K,V>
java.lang.Object
com.github.benmanes.caffeine.guava.CaffeinatedGuavaLoadingCache.SingleLoader<K,V>
- All Implemented Interfaces:
AsyncCacheLoader<K,V>, CacheLoader<K, V>, Serializable
- Direct Known Subclasses:
CaffeinatedGuavaLoadingCache.BulkLoader
- Enclosing class:
CaffeinatedGuavaLoadingCache<K,V>
static class CaffeinatedGuavaLoadingCache.SingleLoader<K,V>
extends Object
implements CacheLoader<K,V>, Serializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CacheLoader
asyncLoad, asyncLoadAll, asyncReload, loadAll
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
cacheLoader
-
-
Constructor Details
-
SingleLoader
-
-
Method Details
-
load
Description copied from interface:CacheLoaderComputes or retrieves the value corresponding tokey.Warning: loading must not attempt to update any mappings of this cache directly.
- Specified by:
loadin interfaceCacheLoader<K,V> - Parameters:
key- the non-null key whose value should be loaded- Returns:
- the value associated with
keyornullif not found
-
reload
Description copied from interface:CacheLoaderComputes or retrieves a replacement value corresponding to an already-cachedkey. If the replacement value is not found then the mapping will be removed ifnullis returned. This method is called when an existing cache entry is refreshed byCaffeine.refreshAfterWrite(Duration), or through a call toLoadingCache.refresh(K).Note: all exceptions thrown by this method will be logged and then swallowed.
- Specified by:
reloadin interfaceCacheLoader<K,V> - Parameters:
key- the non-null key whose value should be loadedoldValue- the non-null old value corresponding tokey- Returns:
- the new value associated with
key, ornullif the mapping is to be removed
-