Package | Description |
---|---|
com.github.benmanes.caffeine.cache |
This package contains caching utilities.
|
Modifier and Type | Method and Description |
---|---|
Caffeine<K,V> |
Caffeine.executor(Executor executor)
Specifies the executor to use when running asynchronous tasks.
|
Caffeine<K,V> |
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<K,V> |
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.
|
static Caffeine<Object,Object> |
Caffeine.from(CaffeineSpec spec)
Constructs a new
Caffeine instance with the settings specified in spec . |
static Caffeine<Object,Object> |
Caffeine.from(String spec)
Constructs a new
Caffeine instance with the settings specified in spec . |
Caffeine<K,V> |
Caffeine.initialCapacity(int initialCapacity)
Sets the minimum total size for the internal data structures.
|
Caffeine<K,V> |
Caffeine.maximumSize(long maximumSize)
Specifies the maximum number of entries the cache may contain.
|
Caffeine<K,V> |
Caffeine.maximumWeight(long maximumWeight)
Specifies the maximum weight of entries the cache may contain.
|
static Caffeine<Object,Object> |
Caffeine.newBuilder()
Constructs a new
Caffeine instance with default settings, including strong keys, strong
values, and no automatic eviction of any kind. |
Caffeine<K,V> |
Caffeine.recordStats()
Enables the accumulation of
CacheStats during the operation of the cache. |
Caffeine<K,V> |
Caffeine.recordStats(Supplier<? extends StatsCounter> statsCounterSupplier)
Enables the accumulation of
CacheStats during the operation of the cache. |
Caffeine<K,V> |
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.
|
<K1 extends K,V1 extends V> |
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.
|
Caffeine<K,V> |
Caffeine.softValues()
Specifies that each value (not key) stored in the cache should be wrapped in a
SoftReference (by default, strong references are used). |
Caffeine<K,V> |
Caffeine.ticker(Ticker ticker)
Specifies a nanosecond-precision time source for use in determining when entries should be
expired or refreshed.
|
Caffeine<K,V> |
Caffeine.weakKeys()
Specifies that each key (not value) stored in the cache should be wrapped in a
WeakReference (by default, strong references are used). |
Caffeine<K,V> |
Caffeine.weakValues()
Specifies that each value (not key) stored in the cache should be wrapped in a
WeakReference (by default, strong references are used). |
<K1 extends K,V1 extends V> |
Caffeine.weigher(Weigher<? super K1,? super V1> weigher)
Specifies the weigher to use in determining the weight of entries.
|
<K1 extends K,V1 extends V> |
Caffeine.writer(CacheWriter<? super K1,? super V1> writer)
Specifies a writer instance that caches should notify each time an entry is explicitly created
or modified, or removed for any reason.
|
Copyright © 2020. All rights reserved.