接口 Cache
- 所有已知子接口:
Level1Cache,Level2Cache
- 所有已知实现类:
CaffeineCache,EhCache,EhCache3,LettuceCache,LettuceGenericCache,LettuceHashCache,MemCache,NullCache,RedisGenericCache,RedisHashCache
public interface Cache
Cache Data Operation Interface
- 作者:
- Winter Lau(javayou@gmail.com)
-
方法概要
修饰符和类型方法说明voidclear()Clear the cachevoidRemove items from the cachedefault boolean判断缓存是否存在Get an item from the cache, nontransactionallyget(Collection<String> keys) 批量获取缓存对象keys()Return all keysvoidAdd an item to the cache, nontransactionally, with failfast semanticsvoid批量插入数据
-
方法详细资料
-
get
Get an item from the cache, nontransactionally- 参数:
key- cache key- 返回:
- the cached object or null
-
get
批量获取缓存对象- 参数:
keys- cache keys- 返回:
- return key-value objects
-
exists
判断缓存是否存在- 参数:
key- cache key- 返回:
- true if key exists
-
put
Add an item to the cache, nontransactionally, with failfast semantics- 参数:
key- cache keyvalue- cache value
-
put
批量插入数据- 参数:
elements- objects to be put in cache
-
keys
Collection<String> keys()Return all keys- 返回:
- 返回键的集合
-
evict
Remove items from the cache- 参数:
keys- Cache key
-
clear
void clear()Clear the cache
-