Package org.jdbi.v3.core.cache
Interface JdbiCacheBuilder
-
- All Known Implementing Classes:
DefaultJdbiCacheBuilder,NoopCacheBuilder
public interface JdbiCacheBuilderBuilder class forJdbiCacheimplementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <K,V>
JdbiCache<K,V>build()Creates an cache instance from the values in the builder.<K,V>
JdbiCache<K,V>buildWithLoader(JdbiCacheLoader<K,V> cacheLoader)Creates an cache instance from the values in the builder and a supplied cache loader.JdbiCacheBuildermaxSize(int maxSize)Sets an upper boundary to the cache size.
-
-
-
Method Detail
-
build
<K,V> JdbiCache<K,V> build()
Creates an cache instance from the values in the builder.- Returns:
- A cache instance.
-
buildWithLoader
<K,V> JdbiCache<K,V> buildWithLoader(JdbiCacheLoader<K,V> cacheLoader)
Creates an cache instance from the values in the builder and a supplied cache loader.- Parameters:
cacheLoader- AJdbiCacheLoaderinstance that is used to create a new value if no value is currently stored in the cache.
-
maxSize
JdbiCacheBuilder maxSize(int maxSize)
Sets an upper boundary to the cache size.- Parameters:
maxSize- Sets the maximum size of the cache. If the value is zero or negative, the cache is unbounded.- Returns:
- The instance of the builder itself.
-
-