public final class ZsetHandler extends Object implements RedisHandler
Modifier and Type | Method and Description |
---|---|
Long |
add(String key,
Map<Double,String> map)
新增字符串存在则更新
|
Long |
add(String key,
String... values)
新增字符串存在则更新
|
Boolean |
add(String key,
String value,
double score)
新增字符串
|
Long |
addAsObj(String key,
Map<Double,Object> map)
新增对象存在则更新
|
Long |
addAsObj(String key,
Object... values)
新增对象存在则更新
|
Boolean |
addAsObj(String key,
Object value,
double score)
新增对象
|
Set<String> |
ascRange(String key,
Long startIndex,
Long endIndex)
正序获取范围内的字符串
|
Set |
ascRangeAsObj(String key,
Long startIndex,
Long endIndex)
正序获取范围内的对象
|
Set<String> |
ascRangeByLex(String key,
Long startSortIndex,
boolean isContainsStart,
Long endSortIndex,
boolean isContainsEnd)
正序获取范围内的字符串
|
Set<String> |
ascRangeByLex(String key,
Long startSortIndex,
boolean isContainsStart,
Long endSortIndex,
boolean isContainsEnd,
Integer count,
Integer offset)
正序获取范围内的字符串
|
Set |
ascRangeByLexAsObj(String key,
Long startSortIndex,
boolean isContainsStart,
Long endSortIndex,
boolean isContainsEnd)
正序获取范围内的对象
|
Set |
ascRangeByLexAsObj(String key,
Long startSortIndex,
boolean isContainsStart,
Long endSortIndex,
boolean isContainsEnd,
Integer count,
Integer offset)
正序获取范围内的对象
|
Long |
ascRemoveRange(String key,
Long startSortIndex,
Long endSortIndex)
正序移除范围内的字符串
|
Long |
ascRemoveRangeAsObj(String key,
Long startSortIndex,
Long endSortIndex)
正序移除范围内的对象
|
Long |
count(String key,
Double min,
Double max)
获取最小-最大之间分数的字符串数量
|
Long |
countAsObj(String key,
Double min,
Double max)
获取最小-最大之间分数的对象数量
|
Set<String> |
descRange(String key,
Long startSortIndex,
Long endSortIndex)
倒序获取范围内的字符串
|
Set |
descRangeAsObj(String key,
Long startSortIndex,
Long endSortIndex)
倒序获取范围内的对象
|
Long |
descRemoveRange(String key,
Long startSortIndex,
Long endSortIndex)
倒序移除范围内的字符串
|
Long |
descRemoveRangeAsObj(String key,
Long startSortIndex,
Long endSortIndex)
倒序移除范围内的对象
|
Set<String> |
getAll(String key)
获取集合字符串
|
Set |
getAllAsObj(String key)
获取集合对象
|
Map<Double,String> |
getAllByScore(String key)
获取集合字符串(带分数)
|
Map<Double,Object> |
getAllByScoreAsObj(String key)
获取集合对象(带分数)
|
org.springframework.data.redis.core.RedisTemplate<String,Object> |
getRedisTemplate()
获取spring redis模板
|
org.springframework.data.redis.core.StringRedisTemplate |
getStringRedisTemplate()
获取spring string redis模板
|
Double |
incrementScore(String key,
String value,
Double score)
字符串分数自增
|
Double |
incrementScoreAsObj(String key,
Object value,
Double score)
对象分数自增
|
Set<String> |
intersect(String key,
String... otherKys)
取字符串交集
|
Long |
intersectAndStore(String key,
String storeKey,
org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate,
Double weight,
String... otherKys)
取字符串交集并存储到新的集合
|
Long |
intersectAndStore(String key,
String storeKey,
org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate,
org.springframework.data.redis.connection.RedisZSetCommands.Weights weights,
String... otherKys)
取字符串交集并存储到新的集合
|
Long |
intersectAndStore(String key,
String storeKey,
String... otherKys)
取字符串交集并存储到新的集合
|
Long |
intersectAndStoreAsObj(String key,
String storeKey,
org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate,
org.springframework.data.redis.connection.RedisZSetCommands.Weights weights,
String... otherKys)
取对象交集并存储到新的集合
|
Long |
intersectAndStoreAsObj(String key,
String storeKey,
org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate,
String... otherKys)
取对象交集并存储到新的集合
|
Long |
intersectAndStoreAsObj(String key,
String storeKey,
String... otherKys)
取对象交集并存储到新的集合
|
Set |
intersectAsObj(String key,
String... otherKys)
取对象交集
|
Map<Double,String> |
intersectByScore(String key,
String... otherKys)
取字符串交集(带分数)
|
Map<Double,Object> |
intersectByScoreAsObj(String key,
String... otherKys)
取对象交集(带分数)
|
String |
popMax(String key)
弹出最大分数值字符串
|
List<String> |
popMax(String key,
int count)
弹出最大分数值字符串
|
Object |
popMaxAsObj(String key)
弹出最大分数值对象
|
List |
popMaxAsObj(String key,
int count)
弹出最大分数值对象
|
Map<Double,String> |
popMaxByScore(String key,
int count)
弹出最大分数值字符串(带分数)
|
Map<Double,Object> |
popMaxByScoreAsObj(String key,
int count)
弹出最大分数值对象(带分数)
|
String |
popMin(String key)
弹出最小分数值字符串
|
List<String> |
popMin(String key,
int count)
弹出最小分数值字符串
|
Object |
popMinAsObj(String key)
弹出最小分数值对象
|
List |
popMinAsObj(String key,
int count)
弹出最小分数值对象
|
Map<Double,String> |
popMinByScore(String key,
int count)
弹出最小分数值字符串(带分数)
|
Map<Double,Object> |
popMinByScoreAsObj(String key,
int count)
弹出最小分数值对象(带分数)
|
Set<String> |
rangeByScore(String key,
Double min,
Double max,
Long count,
Long offset)
获取范围内的字符串
|
Map<Double,String> |
rangeByScore(String key,
Long startSortIndex,
Long endSortIndex)
获取范围内的字符串(带分数)
|
Set |
rangeByScoreAsObj(String key,
Double min,
Double max,
Long count,
Long offset)
获取范围内的对象
|
Map<Double,Object> |
rangeByScoreAsObj(String key,
Long startSortIndex,
Long endSortIndex)
获取范围内的对象(带分数)
|
Map<Double,String> |
rangeByScoreWithScores(String key,
Double min,
Double max)
获取范围内的字符串(带分数)
|
Map<Double,String> |
rangeByScoreWithScores(String key,
Double min,
Double max,
Long count,
Long offset)
获取范围内的字符串(带分数)
|
Map<Double,Object> |
rangeByScoreWithScoresAsObj(String key,
Double min,
Double max)
获取范围内的对象(带分数)
|
Map<Double,Object> |
rangeByScoreWithScoresAsObj(String key,
Double min,
Double max,
Long count,
Long offset)
获取范围内的对象(带分数)
|
Long |
remove(String key,
String... values)
移除字符串
|
Long |
removeAsObj(String key,
Object... values)
移除对象
|
Long |
removeRangeByScore(String key,
Double min,
Double max)
移除范围内的字符串
|
Long |
removeRangeByScoreAsObj(String key,
Double min,
Double max)
移除范围内的对象
|
Set<String> |
reverseRange(String key,
Long startIndex,
Long endIndex)
反转范围内的字符串
|
Set |
reverseRangeAsObj(String key,
Long startIndex,
Long endIndex)
反转范围内的对象
|
Set<String> |
reverseRangeByScore(String key,
Double min,
Double max)
反转范围内的字符串
|
Map<Double,String> |
reverseRangeByScore(String key,
Long startIndex,
Long endIndex)
反转范围内的字符串(带分数)
|
Set |
reverseRangeByScoreAsObj(String key,
Double min,
Double max)
反转范围内的对象
|
Map<Double,Object> |
reverseRangeByScoreAsObj(String key,
Long startIndex,
Long endIndex)
反转范围内的对象(带分数)
|
Map<Double,String> |
reverseRangeByScoreWithScores(String key,
Double min,
Double max)
反转范围内的字符串(带分数)
|
Map<Double,String> |
reverseRangeByScoreWithScores(String key,
Double min,
Double max,
Long count,
Long offset)
反转范围内的字符串(带分数)
|
Map<Double,Object> |
reverseRangeByScoreWithScoresAsObj(String key,
Double min,
Double max)
反转范围内的对象(带分数)
|
Map<Double,Object> |
reverseRangeByScoreWithScoresAsObj(String key,
Double min,
Double max,
Long count,
Long offset)
反转范围内的对象(带分数)
|
Long |
reverseSortIndex(String key,
String value)
反转当前字符串排序索引
|
Long |
reverseSortIndexAsObj(String key,
Object value)
反转当前对象排序索引
|
org.springframework.data.redis.core.Cursor<org.springframework.data.redis.core.ZSetOperations.TypedTuple<String>> |
scan(String key,
Long count,
String pattern)
匹配字符串
|
org.springframework.data.redis.core.Cursor<org.springframework.data.redis.core.ZSetOperations.TypedTuple<Object>> |
scanAsObj(String key,
Long count,
String pattern)
匹配对象
|
Double |
score(String key,
String value)
当前字符串分数
|
Double |
scoreAsObj(String key,
Object value)
当前对象分数
|
Long |
size(String key)
获取字符串数量
|
Long |
sizeAsObj(String key)
获取对象数量
|
Long |
sortIndex(String key,
String value)
获取当前字符串排序索引
|
Long |
sortIndexAsObj(String key,
Object value)
获取当前对象排序索引
|
Set<String> |
union(String key,
String... otherKys)
取字符串并集
|
Long |
unionAndStore(String key,
String storeKey,
org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate,
Double weight,
String... otherKys)
取字符串并集并存储到新的集合
|
Long |
unionAndStore(String key,
String storeKey,
org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate,
org.springframework.data.redis.connection.RedisZSetCommands.Weights weights,
String... otherKys)
取字符串并集并存储到新的集合
|
Long |
unionAndStore(String key,
String storeKey,
String... otherKys)
取字符串并集并存储到新的集合
|
Long |
unionAndStoreAsObj(String key,
String storeKey,
org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate,
org.springframework.data.redis.connection.RedisZSetCommands.Weights weights,
String... otherKys)
取对象并集并存储到新的集合
|
Long |
unionAndStoreAsObj(String key,
String storeKey,
org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate,
String... otherKys)
取对象并集并存储到新的集合
|
Long |
unionAndStoreAsObj(String key,
String storeKey,
String... otherKys)
取对象并集并存储到新的集合
|
Set |
unionAsObj(String key,
String... otherKys)
取对象并集
|
Map<Double,String> |
unionByScore(String key,
String... otherKys)
取字符串并集(带分数)
|
Map<Double,Object> |
unionByScoreAsObj(String key,
String... otherKys)
取对象并集(带分数)
|
public Boolean addAsObj(String key, Object value, double score)
key
- 键value
- 对象score
- 排序public Boolean add(String key, String value, double score)
key
- 键value
- 字符串score
- 排序public Long addAsObj(String key, Map<Double,Object> map)
key
- 键map
- 对象字典public Long add(String key, Map<Double,String> map)
key
- 键map
- 字符串字典public Long addAsObj(String key, Object... values)
key
- 键values
- 对象public Long add(String key, String... values)
key
- 键values
- 字符串public Long sizeAsObj(String key)
key
- 键public Long size(String key)
key
- 键public Long countAsObj(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数public Long count(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数public Set ascRangeAsObj(String key, Long startIndex, Long endIndex)
key
- 键startIndex
- 开始索引endIndex
- 结束索引public Set<String> ascRange(String key, Long startIndex, Long endIndex)
key
- 键startIndex
- 开始索引endIndex
- 结束索引public Set descRangeAsObj(String key, Long startSortIndex, Long endSortIndex)
key
- 键startSortIndex
- 起始排序索引endSortIndex
- 结束排序索引public Set<String> descRange(String key, Long startSortIndex, Long endSortIndex)
key
- 键startSortIndex
- 起始排序索引endSortIndex
- 结束排序索引public Set ascRangeByLexAsObj(String key, Long startSortIndex, boolean isContainsStart, Long endSortIndex, boolean isContainsEnd)
key
- 键startSortIndex
- 起始排序索引isContainsStart
- 是否包含起始endSortIndex
- 结束排序索引isContainsEnd
- 是否包含结束public Set<String> ascRangeByLex(String key, Long startSortIndex, boolean isContainsStart, Long endSortIndex, boolean isContainsEnd)
key
- 键startSortIndex
- 起始排序索引isContainsStart
- 是否包含起始endSortIndex
- 结束排序索引isContainsEnd
- 是否包含结束public Set ascRangeByLexAsObj(String key, Long startSortIndex, boolean isContainsStart, Long endSortIndex, boolean isContainsEnd, Integer count, Integer offset)
key
- 键startSortIndex
- 起始排序索引isContainsStart
- 是否包含起始endSortIndex
- 结束排序索引isContainsEnd
- 是否包含结束count
- 返回数量offset
- 偏移量public Set<String> ascRangeByLex(String key, Long startSortIndex, boolean isContainsStart, Long endSortIndex, boolean isContainsEnd, Integer count, Integer offset)
key
- 键startSortIndex
- 起始排序索引isContainsStart
- 是否包含起始endSortIndex
- 结束排序索引isContainsEnd
- 是否包含结束count
- 返回数量offset
- 偏移量public Set rangeByScoreAsObj(String key, Double min, Double max, Long count, Long offset)
key
- 键min
- 最小分数max
- 最大分数count
- 返回数量offset
- 偏移量public Set<String> rangeByScore(String key, Double min, Double max, Long count, Long offset)
key
- 键min
- 最小分数max
- 最大分数count
- 返回数量offset
- 偏移量public Map<Double,Object> rangeByScoreAsObj(String key, Long startSortIndex, Long endSortIndex)
key
- 键startSortIndex
- 起始排序索引endSortIndex
- 结束排序索引public Map<Double,String> rangeByScore(String key, Long startSortIndex, Long endSortIndex)
key
- 键startSortIndex
- 起始排序索引endSortIndex
- 结束排序索引public Map<Double,Object> rangeByScoreWithScoresAsObj(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数public Map<Double,String> rangeByScoreWithScores(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数public Map<Double,Object> rangeByScoreWithScoresAsObj(String key, Double min, Double max, Long count, Long offset)
key
- 键min
- 最小分数max
- 最大分数count
- 返回数量offset
- 偏移量public Map<Double,String> rangeByScoreWithScores(String key, Double min, Double max, Long count, Long offset)
key
- 键min
- 最小分数max
- 最大分数count
- 返回数量offset
- 偏移量public Set getAllAsObj(String key)
key
- 键public Set<String> getAll(String key)
key
- 键public Map<Double,Object> getAllByScoreAsObj(String key)
key
- 键public Map<Double,String> getAllByScore(String key)
key
- 键public Long sortIndexAsObj(String key, Object value)
key
- 键value
- 对象public Long sortIndex(String key, String value)
key
- 键value
- 字符串public Double scoreAsObj(String key, Object value)
key
- 键value
- 对象public Double score(String key, String value)
key
- 键value
- 字符串public Double incrementScoreAsObj(String key, Object value, Double score)
key
- 键value
- 对象score
- 自增分数public Double incrementScore(String key, String value, Double score)
key
- 键value
- 字符串score
- 自增分数public Long removeAsObj(String key, Object... values)
key
- 键values
- 对象public Long remove(String key, String... values)
key
- 键values
- 字符串public Long ascRemoveRangeAsObj(String key, Long startSortIndex, Long endSortIndex)
key
- 键startSortIndex
- 起始排序索引endSortIndex
- 结束排序索引public Long ascRemoveRange(String key, Long startSortIndex, Long endSortIndex)
key
- 键startSortIndex
- 起始排序索引endSortIndex
- 结束排序索引public Long descRemoveRangeAsObj(String key, Long startSortIndex, Long endSortIndex)
key
- 键startSortIndex
- 起始排序索引endSortIndex
- 结束排序索引public Long descRemoveRange(String key, Long startSortIndex, Long endSortIndex)
key
- 键startSortIndex
- 起始排序索引endSortIndex
- 结束排序索引public Long removeRangeByScoreAsObj(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数public Long removeRangeByScore(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数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 Long intersectAndStoreAsObj(String key, String storeKey, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate, String... otherKys)
key
- 键storeKey
- 存储键aggregate
- 聚合选项otherKys
- 其他键public Long intersectAndStore(String key, String storeKey, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate, org.springframework.data.redis.connection.RedisZSetCommands.Weights weights, String... otherKys)
key
- 键storeKey
- 存储键aggregate
- 聚合选项weights
- 权重选项otherKys
- 其他键public Long intersectAndStoreAsObj(String key, String storeKey, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate, org.springframework.data.redis.connection.RedisZSetCommands.Weights weights, String... otherKys)
key
- 键storeKey
- 存储键aggregate
- 聚合选项weights
- 权重选项otherKys
- 其他键public Long intersectAndStore(String key, String storeKey, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate, Double weight, String... otherKys)
key
- 键storeKey
- 存储键aggregate
- 聚合选项otherKys
- 其他键public Map<Double,Object> intersectByScoreAsObj(String key, String... otherKys)
key
- 键otherKys
- 其他键public Map<Double,String> intersectByScore(String key, String... otherKys)
key
- 键otherKys
- 其他键public Set intersectAsObj(String key, String... otherKys)
key
- 键otherKys
- 其他键public Set<String> intersect(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 Long unionAndStoreAsObj(String key, String storeKey, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate, String... otherKys)
key
- 键storeKey
- 存储键aggregate
- 聚合选项otherKys
- 其他键public Long unionAndStore(String key, String storeKey, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate, org.springframework.data.redis.connection.RedisZSetCommands.Weights weights, String... otherKys)
key
- 键storeKey
- 存储键aggregate
- 聚合选项weights
- 权重选项otherKys
- 其他键public Long unionAndStoreAsObj(String key, String storeKey, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate, org.springframework.data.redis.connection.RedisZSetCommands.Weights weights, String... otherKys)
key
- 键storeKey
- 存储键aggregate
- 聚合选项weights
- 权重选项otherKys
- 其他键public Long unionAndStore(String key, String storeKey, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate aggregate, Double weight, String... otherKys)
key
- 键storeKey
- 存储键aggregate
- 聚合选项otherKys
- 其他键public Map<Double,Object> unionByScoreAsObj(String key, String... otherKys)
key
- 键otherKys
- 其他键public Map<Double,String> unionByScore(String key, String... otherKys)
key
- 键otherKys
- 其他键public Set unionAsObj(String key, String... otherKys)
key
- 键otherKys
- 其他键public Set<String> union(String key, String... otherKys)
key
- 键otherKys
- 其他键public Long reverseSortIndexAsObj(String key, Object value)
key
- 键value
- 对象public Long reverseSortIndex(String key, String value)
key
- 键value
- 字符串public Set reverseRangeAsObj(String key, Long startIndex, Long endIndex)
key
- 键startIndex
- 起始排序索引endIndex
- 结束排序索引public Set<String> reverseRange(String key, Long startIndex, Long endIndex)
key
- 键startIndex
- 起始排序索引endIndex
- 结束排序索引public Set reverseRangeByScoreAsObj(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数public Set<String> reverseRangeByScore(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数public Map<Double,Object> reverseRangeByScoreAsObj(String key, Long startIndex, Long endIndex)
key
- 键startIndex
- 起始排序索引endIndex
- 结束排序索引public Map<Double,String> reverseRangeByScore(String key, Long startIndex, Long endIndex)
key
- 键startIndex
- 起始排序索引endIndex
- 结束排序索引public Map<Double,Object> reverseRangeByScoreWithScoresAsObj(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数public Map<Double,String> reverseRangeByScoreWithScores(String key, Double min, Double max)
key
- 键min
- 最小分数max
- 最大分数public Map<Double,Object> reverseRangeByScoreWithScoresAsObj(String key, Double min, Double max, Long count, Long offset)
key
- 键min
- 最小分数max
- 最大分数count
- 返回数量offset
- 偏移量public Map<Double,String> reverseRangeByScoreWithScores(String key, Double min, Double max, Long count, Long offset)
key
- 键min
- 最小分数max
- 最大分数count
- 返回数量offset
- 偏移量public org.springframework.data.redis.core.Cursor<org.springframework.data.redis.core.ZSetOperations.TypedTuple<Object>> scanAsObj(String key, Long count, String pattern)
key
- 键count
- 数量pattern
- 规则public org.springframework.data.redis.core.Cursor<org.springframework.data.redis.core.ZSetOperations.TypedTuple<String>> scan(String key, Long count, String pattern)
key
- 键count
- 数量pattern
- 规则public Object popMaxAsObj(String key)
key
- 键public String popMax(String key)
key
- 键public List popMaxAsObj(String key, int count)
key
- 键count
- 弹出数量public List<String> popMax(String key, int count)
key
- 键count
- 弹出数量public Map<Double,Object> popMaxByScoreAsObj(String key, int count)
key
- 键count
- 弹出数量public Map<Double,String> popMaxByScore(String key, int count)
key
- 键count
- 弹出数量public Object popMinAsObj(String key)
key
- 键public String popMin(String key)
key
- 键public List popMinAsObj(String key, int count)
key
- 键count
- 弹出数量public List<String> popMin(String key, int count)
key
- 键count
- 弹出数量public Map<Double,Object> popMinByScoreAsObj(String key, int count)
key
- 键count
- 弹出数量public Map<Double,String> popMinByScore(String key, int count)
key
- 键count
- 弹出数量public org.springframework.data.redis.core.RedisTemplate<String,Object> getRedisTemplate()
public org.springframework.data.redis.core.StringRedisTemplate getStringRedisTemplate()
Copyright © 2019. All rights reserved.