Package com.axelor.cache.caffeine
Class CaffeineLoadingCache<K,V>
java.lang.Object
com.axelor.cache.caffeine.CaffeineCache<K,V>
com.axelor.cache.caffeine.CaffeineLoadingCache<K,V>
- Type Parameters:
K- the type of keys maintained by this cacheV- the type of mapped values
- All Implemented Interfaces:
AxelorCache<K,,V> Closeable,AutoCloseable,Iterable<Map.Entry<K,V>>
Caffeine loading cache
This wraps a LoadingCache.
-
Field Summary
Fields inherited from class com.axelor.cache.caffeine.CaffeineCache
cache, locks -
Constructor Summary
ConstructorsConstructorDescriptionCaffeineLoadingCache(com.github.benmanes.caffeine.cache.LoadingCache<K, V> cache) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value associated with thekeyin this cache, obtaining that value from theCacheLoaderif defined and if necessary, otherwise returnsnullif there is no cached value for thekey.Returns a map of the values associated with thekeysin this cache, usingCacheLoaderif defined and if necessary.Methods inherited from class com.axelor.cache.caffeine.CaffeineCache
asMap, cleanUp, close, estimatedSize, get, getLock, invalidate, invalidateAll, put, putAllMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.axelor.cache.AxelorCache
clearExpire, expire, iterator, remainTimeToLiveMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CaffeineLoadingCache
-
-
Method Details
-
get
Description copied from interface:AxelorCacheReturns the value associated with thekeyin this cache, obtaining that value from theCacheLoaderif defined and if necessary, otherwise returnsnullif there is no cached value for thekey.- Specified by:
getin interfaceAxelorCache<K,V> - Overrides:
getin classCaffeineCache<K,V> - Parameters:
key- the key whose associated value is to be returned- Returns:
- the value to which the specified key is mapped, or
nullif this map contains no mapping for the key
-
getAll
Description copied from interface:AxelorCacheReturns a map of the values associated with thekeysin this cache, usingCacheLoaderif defined and if necessary.- Specified by:
getAllin interfaceAxelorCache<K,V> - Overrides:
getAllin classCaffeineCache<K,V> - Parameters:
keys- the keys whose associated values are to be returned- Returns:
- an unmodifiable mapping of keys to values for the specified keys in this cache
-