类 RedisCacheHelper
- java.lang.Object
-
- com.github.developframework.resource.spring.cache.RedisCacheHelper
-
public final class RedisCacheHelper extends Object
redis缓存助手- 作者:
- qiushui on 2020-04-30.
-
-
构造器概要
构造器 构造器 说明 RedisCacheHelper()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static <K,V>
voiddeleteKeys(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K pattern)批量删除static <K,V>
booleanhasKey(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key)判断是否有键static <K,V>
booleanlistEmpty(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key)列表是否为空static <K,V>
develop.toolkit.base.struct.KeyValuePair<Long,V>listFind(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key, Predicate<V> predicate)列表匹配查询匹配单个static <K,V>
develop.toolkit.base.struct.KeyValuePairs<Long,V>listFindAll(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key, Predicate<V> predicate)列表匹配查询static <K,V>
booleanlistNotEmpty(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key)列表是否有值static <K,V>
longlistSize(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key)获取列表长度static <H,HK,HV>
HVreadHash(org.springframework.data.redis.core.RedisTemplate<H,HV> redisTemplate, H key, HK hashKey, Supplier<HV> defaultSupplier)读取Hash值static <K,V>
VreadValue(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key, Duration timeout, Supplier<V> defaultSupplier)读取值
-
-
-
方法详细资料
-
hasKey
public static <K,V> boolean hasKey(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key)判断是否有键- 类型参数:
K-V-- 参数:
redisTemplate-key-- 返回:
-
listSize
public static <K,V> long listSize(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key)获取列表长度- 类型参数:
K-V-- 参数:
redisTemplate-key-- 返回:
-
listNotEmpty
public static <K,V> boolean listNotEmpty(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key)列表是否有值- 类型参数:
K-V-- 参数:
redisTemplate-key-- 返回:
-
listEmpty
public static <K,V> boolean listEmpty(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key)列表是否为空- 类型参数:
K-V-- 参数:
redisTemplate-key-- 返回:
-
listFind
public static <K,V> develop.toolkit.base.struct.KeyValuePair<Long,V> listFind(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key, Predicate<V> predicate)
列表匹配查询匹配单个- 类型参数:
K-V-- 参数:
redisTemplate-key-predicate-- 返回:
-
listFindAll
public static <K,V> develop.toolkit.base.struct.KeyValuePairs<Long,V> listFindAll(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key, Predicate<V> predicate)
列表匹配查询- 类型参数:
K-V-- 参数:
redisTemplate-key-predicate-- 返回:
-
readValue
public static <K,V> V readValue(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K key, Duration timeout, Supplier<V> defaultSupplier)读取值- 类型参数:
K-V-- 参数:
redisTemplate-defaultSupplier-key-- 返回:
-
readHash
public static <H,HK,HV> HV readHash(org.springframework.data.redis.core.RedisTemplate<H,HV> redisTemplate, H key, HK hashKey, Supplier<HV> defaultSupplier)读取Hash值- 类型参数:
H-HK-HV-- 参数:
redisTemplate-key-hashKey-defaultSupplier-- 返回:
-
deleteKeys
public static <K,V> void deleteKeys(org.springframework.data.redis.core.RedisTemplate<K,V> redisTemplate, K pattern)批量删除- 类型参数:
K-V-- 参数:
redisTemplate-pattern-
-
-