public interface CacheHelper
| 限定符和类型 | 方法和说明 |
|---|---|
default boolean |
delete(List<String> keys)
删除指定key
|
default boolean |
delete(String key)
删除指定key
|
default boolean |
exist(String key)
是否存在指定KEY
|
default void |
expire(String key,
TimeUnit timeUnit,
Long timeout)
设置失效时间
|
default boolean |
hashAnyExist(String key,
String[] hashKeys)
判断指定key的hash中包含指定hashKeys中任何一个
|
default void |
hashBatchDel(String key,
Set<String> hashKeys)
删除Hash中指定key的值
|
default void |
hashDel(String key,
String hashKey)
删除Hash中指定key的值
|
default boolean |
hashExist(String key,
String hashKey)
判断指定key的hash中包含指定hashKey
|
default Map<String,String> |
hashGet(String key)
获取指定key的hash缓存
|
default String |
hashGetString(String key,
String hashKey)
获取指定key的hash中对应的值
|
default List<String> |
hashMultiGet(String key,
Collection<String> keys)
获取指定key的hash中对应的值
|
default void |
hashSet(String key,
Map<String,String> hash)
设置指定key的hash缓存
|
default void |
hashSet(String key,
String hashKey,
String hashValue)
设置指定key的hash缓存
|
default Long |
increment(String key)
增加1
|
default Long |
increment(String key,
Long step)
增加1
|
default Set<String> |
keys(String pattern)
模糊匹配
|
default String |
regKey(String key)
去掉前后空格
|
default Long |
setAdd(String key,
String[] values)
向集合中添加
|
default Long |
setAdd(String key,
String[] values,
boolean clear)
向集合中添加
|
default Boolean |
setExist(String key,
String value)
判断集合中是否有对应的value
|
default Boolean |
setIfAbsent(String key,
String value)
获取指定key的String类型缓存
|
default Set<String> |
setMembers(String key)
返回对应key的集合
|
default String |
stringGet(String key)
获取指定key的String类型缓存
|
default void |
stringSet(String key,
String value)
设置指定key的String类型缓存
|
default void |
stringSetExpire(String key,
String value,
long seconds)
设置指定key的String类型缓存,包含过期时间
|
default void |
stringSetExpire(String key,
String value,
long time,
TimeUnit timeUnit)
设置指定key的String类型缓存,包含过期时间
|
default void expire(String key, TimeUnit timeUnit, Long timeout)
key - timeUnit - timeout - default boolean exist(String key)
key - default void stringSetExpire(String key, String value, long time, TimeUnit timeUnit)
key - value - time - timeUnit - 时间单位default void stringSetExpire(String key, String value, long seconds)
key - value - seconds - default List<String> hashMultiGet(String key, Collection<String> keys)
key - keys - default String hashGetString(String key, String hashKey)
key - hashKey - default void hashBatchDel(String key, Set<String> hashKeys)
key - hashKeys - default boolean hashExist(String key, String hashKey)
key - hashKey - default boolean hashAnyExist(String key, String[] hashKeys)
key - hashKeys - default void hashSet(String key, String hashKey, String hashValue)
key - hashKey - hashValue - default boolean delete(String key)
key - default Long setAdd(String key, String[] values, boolean clear)
key - values - clear - 是否清空旧数据Copyright © 2022 Anji-Plus. All rights reserved.