| Package | Description |
|---|---|
| com.google.common.cache |
This package contains caching utilities.
|
| Modifier and Type | Method and Description |
|---|---|
CacheBuilder |
CacheBuilder.concurrencyLevel(int concurrencyLevel)
Guides the allowed concurrency among update operations.
|
CacheBuilder |
CacheBuilder.expireAfterAccess(long duration, TimeUnit
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.
|
CacheBuilder |
CacheBuilder.expireAfterWrite(long duration, TimeUnit
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 CacheBuilder |
CacheBuilder.from(CacheBuilderSpec
Constructs a new
CacheBuilder instance with the settings specified in
spec.
|
static CacheBuilder |
CacheBuilder.from(String
Constructs a new
CacheBuilder instance with the settings specified in
spec.
|
CacheBuilder |
CacheBuilder.initialCapacity(int initialCapacity)
Sets the minimum total size for the internal hash tables.
|
CacheBuilder |
CacheBuilder.maximumSize(long size)
Specifies the maximum number of entries the cache may contain.
|
CacheBuilder |
CacheBuilder.maximumWeight(long weight)
Specifies the maximum weight of entries the cache may contain.
|
static CacheBuilder |
CacheBuilder.newBuilder()
Constructs a new
CacheBuilder instance with default settings, including strong keys, strong values, and no automatic eviction of any kind.
|
CacheBuilder |
CacheBuilder.recordStats()
Enable the accumulation of
CacheStats during the operation of the cache.
|
CacheBuilder |
CacheBuilder.refreshAfterWrite(long duration, TimeUnit
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 |
CacheBuilder.removalListener(RemovalListener
Specifies a listener instance that caches should notify each time an entry is removed for any
reason.
|
CacheBuilder |
CacheBuilder.softValues()
Specifies that each value (not key) stored in the cache should be wrapped in a
SoftReference (by default, strong references are used).
|
CacheBuilder |
CacheBuilder.ticker(Ticker
Specifies a nanosecond-precision time source for use in determining when entries should be expired.
|
CacheBuilder |
CacheBuilder.weakKeys()
Specifies that each key (not value) stored in the cache should be wrapped in a
WeakReference (by default, strong references are used).
|
CacheBuilder |
CacheBuilder.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 |
CacheBuilder.weigher(Weigher
Specifies the weigher to use in determining the weight of entries.
|