Package org.jdbi.v3.cache.caffeine
Class CaffeineLoadingCache<K,V>
java.lang.Object
org.jdbi.v3.cache.caffeine.CaffeineLoadingCache<K,V>
- Type Parameters:
K- The key type.V- The value type.
- All Implemented Interfaces:
JdbiCache<K,V>
Cache implementation using the caffeine cache library.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the cached value for a key.com.github.benmanes.caffeine.cache.stats.CacheStatsgetStats()Return implementation specific statistics for the cache object.getWithLoader(K key, JdbiCacheLoader<K, V> loader) Returns a cached value for a key.
-
Method Details
-
get
Description copied from interface:JdbiCacheReturns the cached value for a key. -
getWithLoader
Description copied from interface:JdbiCacheReturns a cached value for a key. If no value is cached, create a new value using the provided cache loader.- Specified by:
getWithLoaderin interfaceJdbiCache<K,V> - Parameters:
key- The key value. Must not be null.loader- AJdbiCacheLoaderimplementation. May be called with the provided key value.- Returns:
- The cached value or null if no value was cached.
-
getStats
public com.github.benmanes.caffeine.cache.stats.CacheStats getStats()Description copied from interface:JdbiCacheReturn implementation specific statistics for the cache object. This can be used to expose statistic information about the underlying implementation.
-