public final class SetHandler extends Object implements RedisHandler
Modifier and Type | Method and Description |
---|---|
Long |
add(String key,
String... values)
新增字符串
|
Long |
addAsObj(String key,
Object... values)
新增对象
|
Boolean |
contains(String key,
String value)
是否包含字符串
|
Boolean |
containsAsObj(String key,
Object value)
是否包含对象
|
Set<String> |
difference(String key,
String... otherKys)
取字符串差集
|
Long |
differenceAndStore(String key,
String storeKey,
String... otherKys)
取字符串差集并存储到新的集合
|
Long |
differenceAndStoreAsObj(String key,
String storeKey,
String... otherKys)
取对象差集并存储到新的集合
|
Set |
differenceAsObj(String key,
String... otherKys)
取对象差集
|
Set<String> |
distinctRandomMembers(String key,
Long count)
获取不重复的随机字符串
|
Set |
distinctRandomMembersAsObj(String key,
Long count)
获取不重复的随机对象
|
org.springframework.data.redis.core.RedisTemplate<String,Object> |
getRedisTemplate()
获取spring redis模板
|
org.springframework.data.redis.core.StringRedisTemplate |
getStringRedisTemplate()
获取spring string redis模板
|
Set<String> |
intersect(String key,
String... otherKys)
取字符串交集
|
Long |
intersectAndStore(String key,
String storeKey,
String... otherKys)
取字符串交集并存储到新的集合
|
Long |
intersectAndStoreAsObj(String key,
String storeKey,
String... otherKys)
取对象交集并存储到新的集合
|
Set |
intersectAsObj(String key,
String... otherKys)
取对象交集
|
Set<String> |
members(String key)
获取字符串集合
|
Set |
membersAsObj(String key)
获取对象集合
|
Boolean |
move(String key,
String destKey,
String value)
移动字符串
|
Boolean |
moveAsObj(String key,
String destKey,
Object value)
移动对象
|
String |
pop(String key)
弹出字符串
|
List<String> |
pop(String key,
Long count)
弹出字符串
|
<T> T |
popAsObj(Class<T> type,
String key)
弹出对象
|
<T> T |
popAsObj(String key)
弹出对象
|
List |
popAsObj(String key,
Long count)
弹出对象
|
String |
randomMember(String key)
获取可重复的随机字符串
|
<T> T |
randomMemberAsObj(Class<T> type,
String key)
获取可重复的随机对象
|
<T> T |
randomMemberAsObj(String key)
获取可重复的随机对象
|
List<String> |
randomMembers(String key,
Long count)
获取可重复的随机字符串
|
List |
randomMembersAsObj(String key,
Long count)
获取可重复的随机对象
|
Long |
remove(String key,
String... values)
移除字符串
|
Long |
removeAsObj(String key,
Object... values)
移除对象
|
org.springframework.data.redis.core.Cursor<String> |
scan(String key,
Long count,
String pattern)
匹配字符串
|
org.springframework.data.redis.core.Cursor |
scanAsObj(String key,
Long count,
String pattern)
匹配对象
|
Long |
size(String key)
获取字符串数量
|
Long |
sizeAsObj(String key)
获取对象数量
|
Set<String> |
union(String key,
String... otherKys)
取字符串并集
|
Long |
unionAndStore(String key,
String storeKey,
String... otherKys)
取字符串并集并存储到新的集合
|
Long |
unionAndStoreAsObj(String key,
String storeKey,
String... otherKys)
取对象并集并存储到新的集合
|
Set |
unionAsObj(String key,
String... otherKys)
取对象并集
|
public Long addAsObj(String key, Object... values)
key
- 键values
- 对象public Long add(String key, String... values)
key
- 键values
- 字符串public <T> T popAsObj(String key)
T
- 对象类型key
- 键public <T> T popAsObj(Class<T> type, String key)
T
- 返回类型type
- 返回值类型key
- 键public String pop(String key)
key
- 键public List popAsObj(String key, Long count)
key
- 键count
- 对象个数public List<String> pop(String key, Long count)
key
- 键count
- 字符串个数public Long removeAsObj(String key, Object... values)
key
- 键values
- 对象public Long remove(String key, String... values)
key
- 键values
- 字符串public Boolean moveAsObj(String key, String destKey, Object value)
key
- 键destKey
- 目标键value
- 对象public Boolean move(String key, String destKey, String value)
key
- 键destKey
- 目标键value
- 字符串public Long sizeAsObj(String key)
key
- 键public Long size(String key)
key
- 键public Boolean containsAsObj(String key, Object value)
key
- 键value
- 对象public Boolean contains(String key, String value)
key
- 键value
- 字符串public Set distinctRandomMembersAsObj(String key, Long count)
key
- 键count
- 数量public Set<String> distinctRandomMembers(String key, Long count)
key
- 键count
- 数量public List randomMembersAsObj(String key, Long count)
key
- 键count
- 数量public List<String> randomMembers(String key, Long count)
key
- 键count
- 数量public <T> T randomMemberAsObj(String key)
T
- 对象类型key
- 键public <T> T randomMemberAsObj(Class<T> type, String key)
T
- 返回类型type
- 返回值类型key
- 键public String randomMember(String key)
key
- 键public Set membersAsObj(String key)
key
- 键public Set<String> members(String key)
key
- 键public Set differenceAsObj(String key, String... otherKys)
key
- 键otherKys
- 其他键public Set<String> difference(String key, String... otherKys)
key
- 键otherKys
- 其他键public Long differenceAndStoreAsObj(String key, String storeKey, String... otherKys)
key
- 键storeKey
- 存储键otherKys
- 其他键public Long differenceAndStore(String key, String storeKey, String... otherKys)
key
- 键storeKey
- 存储键otherKys
- 其他键public Set intersectAsObj(String key, String... otherKys)
key
- 键otherKys
- 其他键public Set<String> intersect(String key, String... otherKys)
key
- 键otherKys
- 其他键public Long intersectAndStoreAsObj(String key, String storeKey, String... otherKys)
key
- 键storeKey
- 存储键otherKys
- 其他键public Long intersectAndStore(String key, String storeKey, String... otherKys)
key
- 键storeKey
- 存储键otherKys
- 其他键public Set unionAsObj(String key, String... otherKys)
key
- 键otherKys
- 其他键public Set<String> union(String key, String... otherKys)
key
- 键otherKys
- 其他键public Long unionAndStoreAsObj(String key, String storeKey, String... otherKys)
key
- 键storeKey
- 存储键otherKys
- 其他键public Long unionAndStore(String key, String storeKey, String... otherKys)
key
- 键storeKey
- 存储键otherKys
- 其他键public org.springframework.data.redis.core.Cursor scanAsObj(String key, Long count, String pattern)
key
- 键count
- 数量pattern
- 规则public org.springframework.data.redis.core.Cursor<String> scan(String key, Long count, String pattern)
key
- 键count
- 数量pattern
- 规则public org.springframework.data.redis.core.RedisTemplate<String,Object> getRedisTemplate()
public org.springframework.data.redis.core.StringRedisTemplate getStringRedisTemplate()
Copyright © 2019. All rights reserved.