| 构造器和说明 |
|---|
RedisSetProvider(org.springframework.data.redis.core.RedisTemplate template) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(String key,
Collection<T> values)
添加多个
|
void |
add(String key,
T value)
添加
|
void |
clear(String key)
清空 key 集合
|
Boolean |
contains(String key,
T value)
判断是否存在
|
Set<T> |
difference(Collection<String> keys)
获取 keys 中不同的值
|
Set<T> |
difference(String key,
Collection<String> otherKeys)
获取 key 中存在,otherKeys 中不存在的值
|
Set<T> |
difference(String key,
String otherKey)
获取 key 中存在,otherKey 中不存在的值
|
Long |
differenceAndStore(Collection<String> keys,
String destKey)
获取 keys 中不同的值,并存在 destKey 键下
|
Long |
differenceAndStore(String key,
Collection<String> otherKeys,
String destKey)
获取 key 中存在,otherKey 中不存在的值,并存在 destKey 键下
|
Set<T> |
distinctRandomValues(String key,
long count)
获取 count 个 key 的不重复随机值
|
Set<T> |
intersect(Collection<String> keys)
获取 keys 值的交集
|
Set<T> |
intersect(String key,
Collection<String> otherKeys)
获取 key 和 otherKeys 值的交集
|
Set<T> |
intersect(String key,
String otherKey)
获取 key 和 otherKey 值的交集
|
Long |
intersectAndStore(Collection<String> keys,
String destKey)
获取 keys 值的交集,并存在 destKey 键下
|
Long |
intersectAndStore(String key,
Collection<String> otherKeys,
String destKey)
获取 key 和 otherKeys 值的交集,并存在 destKey 键下
|
Boolean |
move(String key,
T value,
String destKey)
从 key 集合中移动 value 到 destKey 集合
|
T |
pop(String key)
从 key 中随机删除一个元素并返回删除的元素
|
List<T> |
pop(String key,
long count)
从 key 中随机删除 count 个元素并返回删除的元素
|
T |
randomValue(String key)
获取 key 的随机值
|
List<T> |
randomValues(String key,
long count)
获取 count 个 key 的随机值
|
Long |
remove(String key,
Collection<T> values)
删除值在 values 中的所有元素,返回删除元素的个数
|
void |
remove(String key,
T value)
删除值为 value 的所有元素
|
Set<T> |
scan(String key,
String pattern)
获取满足pattern表达式条件的所有元素
|
Long |
size(String key)
返回集合的长度
|
Set<T> |
union(Collection<String> keys)
获取 keys 值的并集
|
Set<T> |
union(String key,
Collection<String> otherKeys)
获取 key 和 otherKeys 值的并集
|
Set<T> |
union(String key,
String otherKey)
获取 key 和 otherKey 值的并集
|
Long |
unionAndStore(Collection<String> keys,
String destKey)
获取 keys 值的并集,并存在 destKey 键下
|
Long |
unionAndStore(String key,
Collection<String> otherKeys,
String destKey)
获取 key 和 otherKeys 值的并集,并存在 destKey 键下
|
Set<T> |
values(String key)
获取 key 的全部值
|
public RedisSetProvider(org.springframework.data.redis.core.RedisTemplate template)
public void add(String key, Collection<T> values)
ISetCachepublic Long remove(String key, Collection<T> values)
ISetCachepublic Boolean move(String key, T value, String destKey)
ISetCachepublic T randomValue(String key)
ISetCacherandomValue 在接口中 ISetCache<T>key - 键public List<T> randomValues(String key, long count)
ISetCacherandomValues 在接口中 ISetCache<T>key - 键count - 数量public Set<T> distinctRandomValues(String key, long count)
ISetCachedistinctRandomValues 在接口中 ISetCache<T>key - 键count - 数量public Set<T> intersect(String key, String otherKey)
ISetCachepublic Set<T> intersect(String key, Collection<String> otherKeys)
ISetCachepublic Set<T> intersect(Collection<String> keys)
ISetCachepublic Long intersectAndStore(String key, Collection<String> otherKeys, String destKey)
ISetCacheintersectAndStore 在接口中 ISetCache<T>key - 键otherKeys - 其他键集合destKey - 目标键public Long intersectAndStore(Collection<String> keys, String destKey)
ISetCacheintersectAndStore 在接口中 ISetCache<T>keys - 键集合destKey - 目标键public Set<T> union(String key, Collection<String> otherKeys)
ISetCachepublic Set<T> union(Collection<String> keys)
ISetCachepublic Long unionAndStore(String key, Collection<String> otherKeys, String destKey)
ISetCacheunionAndStore 在接口中 ISetCache<T>key - 键otherKeys - 其他键集合destKey - 目标键public Long unionAndStore(Collection<String> keys, String destKey)
ISetCacheunionAndStore 在接口中 ISetCache<T>keys - 键集合destKey - 目标键public Set<T> difference(String key, String otherKey)
ISetCachedifference 在接口中 ISetCache<T>key - 键otherKey - 其他键public Set<T> difference(String key, Collection<String> otherKeys)
ISetCachedifference 在接口中 ISetCache<T>key - 键otherKeys - 其他键集合public Set<T> difference(Collection<String> keys)
ISetCachedifference 在接口中 ISetCache<T>keys - 键集合public Long differenceAndStore(String key, Collection<String> otherKeys, String destKey)
ISetCachedifferenceAndStore 在接口中 ISetCache<T>key - 键otherKeys - 其他键集合destKey - 目标键public Long differenceAndStore(Collection<String> keys, String destKey)
ISetCachedifferenceAndStore 在接口中 ISetCache<T>keys - 键集合destKey - 目标键Copyright © 2021. All rights reserved.