Uses of Class
com.github.benmanes.caffeine.cache.Caffeine
Packages that use Caffeine
Package
Description
This package contains in-memory caching functionality.
-
Uses of Caffeine in com.github.benmanes.caffeine.cache
Methods in com.github.benmanes.caffeine.cache that return CaffeineModifier and TypeMethodDescriptionCaffeine.evictionListener(RemovalListener<? super K1, ? super V1> evictionListener) Specifies a listener instance that caches should notify each time an entry is evicted.Specifies the executor to use when running asynchronous tasks.Caffeine.expireAfter(Expiry<? super K1, ? super V1> expiry) Specifies that each entry should be automatically removed from the cache once a duration has elapsed after the entry's creation, the most recent replacement of its value, or its last read.Caffeine.expireAfterAccess(long duration, TimeUnit unit) Specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last read.Caffeine.expireAfterAccess(Duration duration) Specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access.Caffeine.expireAfterWrite(long duration, TimeUnit unit) Specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value.Caffeine.expireAfterWrite(Duration duration) Specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value.Caffeine.from(CaffeineSpec spec) Constructs a newCaffeineinstance with the settings specified inspec.Constructs a newCaffeineinstance with the settings specified inspec.Caffeine.initialCapacity(int initialCapacity) Sets the minimum total size for the internal data structures.Caffeine.maximumSize(long maximumSize) Specifies the maximum number of entries the cache may contain.Caffeine.maximumWeight(long maximumWeight) Specifies the maximum weight of entries the cache may contain.Caffeine.newBuilder()Constructs a newCaffeineinstance with default settings, including strong keys, strong values, and no automatic eviction of any kind.Caffeine.recordStats()Enables the accumulation ofCacheStatsduring the operation of the cache.Caffeine.recordStats(Supplier<? extends StatsCounter> statsCounterSupplier) Enables the accumulation ofCacheStatsduring the operation of the cache.Caffeine.refreshAfterWrite(long duration, TimeUnit unit) Specifies that active entries are eligible for automatic refresh once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value.Caffeine.refreshAfterWrite(Duration duration) Specifies that active entries are eligible for automatic refresh once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value.Caffeine.removalListener(RemovalListener<? super K1, ? super V1> removalListener) Specifies a listener instance that caches should notify each time an entry is removed for any reason.Specifies the scheduler to use when scheduling routine maintenance based on an expiration event.Caffeine.softValues()Specifies that each value (not key) stored in the cache should be wrapped in aSoftReference(by default, strong references are used).Specifies a nanosecond-precision time source for use in determining when entries should be expired or refreshed.Caffeine.weakKeys()Specifies that each key (not value) stored in the cache should be wrapped in aWeakReference(by default, strong references are used).Caffeine.weakValues()Specifies that each value (not key) stored in the cache should be wrapped in aWeakReference(by default, strong references are used).Specifies the weigher to use in determining the weight of entries.