Interface CacheConfiguration<K,V>
- Type Parameters:
K- the cache key typeV- the cache value type
public interface CacheConfiguration<K,V>
Encapsulates the configuration of a Caffeine cache.
- Author:
- Paul Ferraro
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder of a Caffeine cache configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> CacheConfiguration.Builder <K, V> builder()Creates a builder of cache configuration.When present, defines a listener to be notified on entry eviction.Returns the expiry logic of this cache.When present, defines the maximum weight for entries within this cache.When present, defines a listener to be notified on entry removal.com.github.benmanes.caffeine.cache.SchedulerReturns a scheduler of asynchronous tasks.Returns a weigher of cache entries.
-
Method Details
-
getMaxWeight
OptionalLong getMaxWeight()When present, defines the maximum weight for entries within this cache.- Returns:
- an optional size-based eviction threshold
-
getExpiry
-
getWeigher
-
getEvictionListener
-
getRemovalListener
-
getScheduler
com.github.benmanes.caffeine.cache.Scheduler getScheduler()Returns a scheduler of asynchronous tasks.- Returns:
- a scheduler of asynchronous tasks.
-
builder
Creates a builder of cache configuration.- Type Parameters:
K- the cache key typeV- the cache value type- Returns:
- a builder of cache configuration.
-