Constructor and Description |
---|
CaffeineCache(com.github.benmanes.caffeine.cache.LoadingCache<String,Serializable> loadingCache,
com.github.benmanes.caffeine.cache.LoadingCache<String,Serializable> temporaryLoadingCache) |
Modifier and Type | Method and Description |
---|---|
ConcurrentMap<String,Serializable> |
asMap() |
void |
clear()
清空所有缓存
|
Serializable |
get(String key)
根据key获取value
|
<T> T |
get(String key,
Class<T> clazz)
根据key获取value
|
Collection<String> |
keys()
获取所有的key
|
void |
put(String key,
Serializable value)
将key value保存到缓存中
|
void |
putTemporary(String key,
Serializable value)
临时添加一个值,用于防止缓存穿透攻击
|
void |
remove(String key)
删除一个key
|
long |
size() |
public CaffeineCache(com.github.benmanes.caffeine.cache.LoadingCache<String,Serializable> loadingCache, com.github.benmanes.caffeine.cache.LoadingCache<String,Serializable> temporaryLoadingCache)
public void clear()
ICache
public Serializable get(String key)
ICache
public Collection<String> keys()
ICache
public void put(String key, Serializable value)
ICache
public void putTemporary(String key, Serializable value)
ICache
putTemporary
in interface ICache
public ConcurrentMap<String,Serializable> asMap()
public long size()
Copyright © 2018. All rights reserved.