public class CacheBuilder<K,V> extends Object
| 构造器和说明 |
|---|
CacheBuilder() |
| 限定符和类型 | 方法和说明 |
|---|---|
Cache<K,V> |
build()
Build the cache according to the builder attribute.
|
static <K,V> CacheBuilder<K,V> |
builder() |
CacheBuilder<K,V> |
expireNanos(long duration,
TimeUnit unit)
Set expiration time.
|
CacheBuilder<K,V> |
initializeCapacity(int initializeCapacity)
Set the initial capacity of the cache pair.
|
CacheBuilder<K,V> |
lru(boolean lru)
Does the constructed cache support lru.
|
CacheBuilder<K,V> |
maximumSize(int maximumSize)
Set the maximum capacity of the cache pair.
|
CacheBuilder<K,V> |
sync(boolean sync)
Set whether the cache method is synchronized.
|
public static <K,V> CacheBuilder<K,V> builder()
public CacheBuilder<K,V> expireNanos(long duration, TimeUnit unit)
public CacheBuilder<K,V> maximumSize(int maximumSize)
maximumSize - maximum capacitypublic CacheBuilder<K,V> sync(boolean sync)
sync - if sync value is true, each method of the constructed cache is synchronized.public CacheBuilder<K,V> lru(boolean lru)
lru - If the cache built for true is an lru cache.public CacheBuilder<K,V> initializeCapacity(int initializeCapacity)
initializeCapacity - initialize capacityCopyright © 2018–2024 Alibaba Group. All rights reserved.