public class CaffeineCache extends Object implements Level1Cache
Constructor and Description |
---|
CaffeineCache(com.github.benmanes.caffeine.cache.Cache<String,Object> cache,
long size,
long expire) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the cache
|
void |
evict(String... keys)
Remove items from the cache
|
Map<String,Object> |
get(Collection<String> keys)
批量获取缓存对象
|
Object |
get(String key)
Get an item from the cache, nontransactionally
|
Collection<String> |
keys()
Return all keys
|
void |
put(Map<String,Object> elements)
批量插入数据
|
void |
put(String key,
Object value)
Add an item to the cache, nontransactionally, with
failfast semantics
|
long |
size()
返回该缓存区域中,内存存储对象的最大数量
|
long |
ttl()
返回该缓存区域的 TTL 设置(单位:秒)
|
public long ttl()
Level1Cache
ttl
in interface Level1Cache
public long size()
Level1Cache
size
in interface Level1Cache
public Object get(String key)
Cache
public Map<String,Object> get(Collection<String> keys)
Cache
public void put(String key, Object value)
Cache
public Collection<String> keys()
Cache
public void evict(String... keys)
Cache
Copyright © 2018. All rights reserved.