Interface ZSetOperations<K,V>
@NullUnmarked
public interface ZSetOperations<K,V>
Redis ZSet/sorted set specific operations.
- Author:
- Costin Leau, Christoph Strobl, Mark Paluch, Rosty Kerei, Wongoo (望哥), Andrey Shlykov, Shyngys Sapraliyev, Gunha Hwang
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceTyped ZSet tuple. -
Method Summary
Modifier and TypeMethodDescriptionadd(@NonNull K key, @NonNull Set<@NonNull ZSetOperations.TypedTuple<V>> tuples) Addtuplesto a sorted set atkey, or update itsscoreif it already exists.Addvalueto a sorted set atkey, or update itsscoreif it already exists.addIfAbsent(@NonNull K key, @NonNull Set<@NonNull ZSetOperations.TypedTuple<V>> tuples) Addtuplesto a sorted set atkeyif it does not already exists.addIfAbsent(@NonNull K key, @NonNull V value, double score) Addvalueto a sorted set atkeyif it does not already exists.Count number of elements within sorted set with scores betweenminandmax.difference(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys) Diff sortedsets.difference(@NonNull K key, @NonNull K otherKey) Diff sortedsets.differenceAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey) Diff sortedsetsand store result in destinationdestKey.Set<@NonNull ZSetOperations.TypedTuple<V>>differenceWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys) Diff sortedsets.default Set<@NonNull ZSetOperations.TypedTuple<V>>differenceWithScores(@NonNull K key, @NonNull K otherKey) Diff sortedsets.distinctRandomMembers(@NonNull K key, long count) Getcountdistinct random elements from set atkey.Set<@NonNull ZSetOperations.TypedTuple<V>>distinctRandomMembersWithScore(@NonNull K key, long count) Getcountdistinct random elements with their score from set atkey.@NonNull RedisOperations<K,V> incrementScore(@NonNull K key, @NonNull V value, double delta) Increment the score of element withvaluein sorted set byincrement.intersect(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys) Intersect sortedsets.Intersect sortedsets.intersectAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey) Intersect sorted sets atkeyandotherKeysand store result in destinationdestKey.default LongintersectAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey, @NonNull Aggregate aggregate) Intersect sorted sets atkeyandotherKeysand store result in destinationdestKey.intersectAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey, @NonNull Aggregate aggregate, @NonNull Weights weights) Intersect sorted sets atkeyandotherKeysand store result in destinationdestKey.intersectAndStore(@NonNull K key, @NonNull K otherKey, @NonNull K destKey) Intersect sorted sets atkeyandotherKeyand store result in destinationdestKey.Set<@NonNull ZSetOperations.TypedTuple<V>>intersectWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys) Intersect sortedsets.default Set<ZSetOperations.TypedTuple<V>>intersectWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull Aggregate aggregate) Intersect sorted sets atkeyandotherKeys.Set<@NonNull ZSetOperations.TypedTuple<V>>intersectWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull Aggregate aggregate, @NonNull Weights weights) Intersect sortedsets.default Set<@NonNull ZSetOperations.TypedTuple<V>>intersectWithScores(@NonNull K key, @NonNull K otherKey) Intersect sortedsets.Count number of elements within sorted set with value betweenRange.getLowerBound()andRange.getUpperBound()applying lexicographical ordering.Remove and return the value with its score having the highest score from sorted set atkey.Remove and returncountvalues with their score having the highest score from sorted set atkey.Remove and return the value with its score having the highest score from sorted set atkey.default ZSetOperations.TypedTuple<V>Remove and return the value with its score having the highest score from sorted set atkey.Remove and return the value with its score having the lowest score from sorted set atkey.Set<@NonNull ZSetOperations.TypedTuple<V>>Remove and returncountvalues with their score having the lowest score from sorted set atkey.Remove and return the value with its score having the lowest score from sorted set atkey.default ZSetOperations.TypedTuple<@NonNull V>Remove and return the value with its score having the lowest score from sorted set atkey.randomMember(@NonNull K key) Get random element from set atkey.randomMembers(@NonNull K key, long count) Getcountrandom elements from set atkey.randomMembersWithScore(@NonNull K key, long count) Getcountrandom elements with their score from set atkey.randomMemberWithScore(@NonNull K key) Get random element with its score from set atkey.Get elements betweenstartandendfrom sorted set.default LongrangeAndStoreByLex(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<String> range) Store all elements atdstKeywith lexicographical ordering from ZSET atsrcKeywith a value betweenRange.getLowerBound()andRange.getUpperBound().rangeAndStoreByLex(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<String> range, @NonNull Limit limit) Store n elements atdstKey, where n =Limit.getCount(), starting atLimit.getOffset()with lexicographical ordering from ZSET atsrcKeywith a value betweenRange.getLowerBound()andRange.getUpperBound().default LongrangeAndStoreByScore(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<? extends Number> range) Store all elements atdstKeywith ordering by score from ZSET atsrcKeywith a score betweenRange.getLowerBound()andRange.getUpperBound().rangeAndStoreByScore(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<? extends Number> range, @NonNull Limit limit) Store n elements atdstKey, where n =Limit.getCount(), starting atLimit.getOffset()with ordering by score from ZSET atsrcKeywith a score betweenRange.getLowerBound()andRange.getUpperBound().rangeByLex(@NonNull K key, @NonNull Range<String> range) Get all elements with lexicographical ordering from ZSET atkeywith a value betweenRange.getLowerBound()andRange.getUpperBound().rangeByLex(@NonNull K key, @NonNull Range<String> range, @NonNull Limit limit) Get all elements n elements, where n =Limit.getCount(), starting atLimit.getOffset()with lexicographical ordering from ZSET atkeywith a value betweenRange.getLowerBound()andRange.getUpperBound().rangeByScore(@NonNull K key, double min, double max) Get elements where score is betweenminandmaxfrom sorted set.rangeByScore(@NonNull K key, double min, double max, long offset, long count) Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.Set<@NonNull ZSetOperations.TypedTuple<V>>rangeByScoreWithScores(@NonNull K key, double min, double max) Set<@NonNull ZSetOperations.TypedTuple<V>>rangeByScoreWithScores(@NonNull K key, double min, double max, long offset, long count) Set<@NonNull ZSetOperations.TypedTuple<V>>rangeWithScores(@NonNull K key, long start, long end) Determine the index of element withvaluein a sorted set.Removevaluesfrom sorted set.removeRange(@NonNull K key, long start, long end) Remove elements in range betweenstartandendfrom sorted set withkey.removeRangeByLex(@NonNull K key, @NonNull Range<String> range) Remove elements inRangefrom sorted set with key.removeRangeByScore(@NonNull K key, double min, double max) Remove elements with scores betweenminandmaxfrom sorted set withkey.reverseRange(@NonNull K key, long start, long end) Get elements in range fromstarttoendfrom sorted set ordered from high to low.default LongreverseRangeAndStoreByLex(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<String> range) Store all elements atdstKeywith reverse lexicographical ordering from ZSET atsrcKeywith a value betweenRange.getLowerBound()andRange.getUpperBound().reverseRangeAndStoreByLex(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<String> range, @NonNull Limit limit) Store n elements atdstKey, where n =Limit.getCount(), starting atLimit.getOffset()with reverse lexicographical ordering from ZSET atsrcKeywith a value betweenRange.getLowerBound()andRange.getUpperBound().default LongreverseRangeAndStoreByScore(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<? extends Number> range) Store all elements atdstKeywith reverse ordering by score from ZSET atsrcKeywith a score betweenRange.getLowerBound()andRange.getUpperBound().reverseRangeAndStoreByScore(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<? extends Number> range, @NonNull Limit limit) Store n elements atdstKey, where n =Limit.getCount(), starting atLimit.getOffset()with reverse ordering by score from ZSET atsrcKeywith a score betweenRange.getLowerBound()andRange.getUpperBound().reverseRangeByLex(@NonNull K key, @NonNull Range<String> range) Get all elements with reverse lexicographical ordering from ZSET atkeywith a value betweenRange.getLowerBound()andRange.getUpperBound().reverseRangeByLex(@NonNull K key, @NonNull Range<String> range, @NonNull Limit limit) Get all elements n elements, where n =Limit.getCount(), starting atLimit.getOffset()with reverse lexicographical ordering from ZSET atkeywith a value betweenRange.getLowerBound()andRange.getUpperBound().reverseRangeByScore(@NonNull K key, double min, double max) Get elements where score is betweenminandmaxfrom sorted set ordered from high to low.reverseRangeByScore(@NonNull K key, double min, double max, long offset, long count) Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.Set<@NonNull ZSetOperations.TypedTuple<V>>reverseRangeByScoreWithScores(@NonNull K key, double min, double max) Set<@NonNull ZSetOperations.TypedTuple<V>>reverseRangeByScoreWithScores(@NonNull K key, double min, double max, long offset, long count) Get set ofTuplein range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.Set<@NonNull ZSetOperations.TypedTuple<V>>reverseRangeWithScores(@NonNull K key, long start, long end) reverseRank(@NonNull K key, @NonNull Object value) Determine the index of element withvaluein a sorted set when scored high to low.@NonNull Cursor<@NonNull ZSetOperations.TypedTuple<V>>scan(@NonNull K key, @Nullable ScanOptions options) Use aCursorto iterate over entries zset atkey.Get the score of element withvaluefrom sorted set with keykey.Get the scores of elements withvaluesfrom sorted set with keykey.Returns the number of elements of the sorted set stored with givenkey.union(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys) Union sortedsets.Union sortedsets.unionAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey) Union sorted sets atkeyandotherKeysand store result in destinationdestKey.default LongunionAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey, @NonNull Aggregate aggregate) Union sorted sets atkeyandotherKeysand store result in destinationdestKey.unionAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey, @NonNull Aggregate aggregate, @NonNull Weights weights) Union sorted sets atkeyandotherKeysand store result in destinationdestKey.unionAndStore(@NonNull K key, @NonNull K otherKey, @NonNull K destKey) Union sorted sets atkeyandotherKeysand store result in destinationdestKey.Set<@NonNull ZSetOperations.TypedTuple<V>>unionWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys) Union sortedsets.default Set<@NonNull ZSetOperations.TypedTuple<V>>unionWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull Aggregate aggregate) Union sorted sets atkeyandotherKeys.Set<@NonNull ZSetOperations.TypedTuple<V>>unionWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull Aggregate aggregate, @NonNull Weights weights) Union sortedsets.default Set<@NonNull ZSetOperations.TypedTuple<V>>unionWithScores(@NonNull K key, @NonNull K otherKey) Union sortedsets.Get the size of sorted set withkey.
-
Method Details
-
add
Addvalueto a sorted set atkey, or update itsscoreif it already exists.- Parameters:
key- must not be null.value- the value.score- the score.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
addIfAbsent
Addvalueto a sorted set atkeyif it does not already exists.- Parameters:
key- must not be null.value- the value.score- the score.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.5
- See Also:
-
add
Addtuplesto a sorted set atkey, or update itsscoreif it already exists.- Parameters:
key- must not be null.tuples- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
addIfAbsent
Addtuplesto a sorted set atkeyif it does not already exists.- Parameters:
key- must not be null.tuples- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.5
- See Also:
-
remove
Removevaluesfrom sorted set. Return number of removed elements.- Parameters:
key- must not be null.values- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
incrementScore
Increment the score of element withvaluein sorted set byincrement.- Parameters:
key- must not be null.value- the value.delta- the delta to add. Can be negative.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
randomMember
Get random element from set atkey.- Parameters:
key- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
distinctRandomMembers
Getcountdistinct random elements from set atkey.- Parameters:
key- must not be null.count- number of members to return.- Returns:
- empty
Setifkeydoes not exist. - Throws:
IllegalArgumentException- if count is negative.- Since:
- 2.6
- See Also:
-
randomMembers
Getcountrandom elements from set atkey.- Parameters:
key- must not be null.count- number of members to return.- Returns:
- empty
Listifkeydoes not exist or null when used in pipeline / transaction. - Throws:
IllegalArgumentException- if count is negative.- Since:
- 2.6
- See Also:
-
randomMemberWithScore
Get random element with its score from set atkey.- Parameters:
key- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
distinctRandomMembersWithScore
Set<@NonNull ZSetOperations.TypedTuple<V>> distinctRandomMembersWithScore(@NonNull K key, long count) Getcountdistinct random elements with their score from set atkey.- Parameters:
key- must not be null.count- number of members to return.- Returns:
- empty
Setifkeydoes not exist. - Throws:
IllegalArgumentException- if count is negative.- Since:
- 2.6
- See Also:
-
randomMembersWithScore
Getcountrandom elements with their score from set atkey.- Parameters:
key- must not be null.count- number of members to return.- Returns:
- empty
Listifkeydoes not exist or null when used in pipeline / transaction. - Throws:
IllegalArgumentException- if count is negative.- Since:
- 2.6
- See Also:
-
rank
Determine the index of element withvaluein a sorted set.- Parameters:
key- must not be null.value- the value.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
reverseRank
Determine the index of element withvaluein a sorted set when scored high to low.- Parameters:
key- must not be null.value- the value.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
range
Get elements betweenstartandendfrom sorted set.- Parameters:
key- must not be null.start-end-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
rangeWithScores
- Parameters:
key- must not be null.start-end-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
rangeByScore
Get elements where score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min-max-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
rangeByScoreWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> rangeByScoreWithScores(@NonNull K key, double min, double max) - Parameters:
key- must not be null.min-max-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
rangeByScore
Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min-max-offset-count-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
rangeByScoreWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> rangeByScoreWithScores(@NonNull K key, double min, double max, long offset, long count) - Parameters:
key-min-max-offset-count-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
reverseRange
Get elements in range fromstarttoendfrom sorted set ordered from high to low.- Parameters:
key- must not be null.start-end-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
reverseRangeWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> reverseRangeWithScores(@NonNull K key, long start, long end) - Parameters:
key- must not be null.start-end-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
reverseRangeByScore
Get elements where score is betweenminandmaxfrom sorted set ordered from high to low.- Parameters:
key- must not be null.min-max-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
reverseRangeByScoreWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> reverseRangeByScoreWithScores(@NonNull K key, double min, double max) - Parameters:
key- must not be null.min-max-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
reverseRangeByScore
Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.- Parameters:
key- must not be null.min-max-offset-count-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
reverseRangeByScoreWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> reverseRangeByScoreWithScores(@NonNull K key, double min, double max, long offset, long count) Get set ofTuplein range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.- Parameters:
key- must not be null.min-max-offset-count-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
count
Count number of elements within sorted set with scores betweenminandmax.- Parameters:
key- must not be null.min-max-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lexCount
Count number of elements within sorted set with value betweenRange.getLowerBound()andRange.getUpperBound()applying lexicographical ordering.- Parameters:
key- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
popMin
Remove and return the value with its score having the lowest score from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
popMin
Remove and returncountvalues with their score having the lowest score from sorted set atkey.- Parameters:
key- must not be null.count- number of elements to pop.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
popMin
Remove and return the value with its score having the lowest score from sorted set atkey.
Blocks connection until element available ortimeoutreached.- Parameters:
key- must not be null.timeout-unit- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
popMin
Remove and return the value with its score having the lowest score from sorted set atkey.
Blocks connection until element available ortimeoutreached.- Parameters:
key- must not be null.timeout- must not be null.- Returns:
- can be null.
- Throws:
IllegalArgumentException- if the timeout is null or negative.- Since:
- 2.6
- See Also:
-
popMax
Remove and return the value with its score having the highest score from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
popMax
Remove and returncountvalues with their score having the highest score from sorted set atkey.- Parameters:
key- must not be null.count- number of elements to pop.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
popMax
Remove and return the value with its score having the highest score from sorted set atkey.
Blocks connection until element available ortimeoutreached.- Parameters:
key- must not be null.timeout-unit- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
popMax
Remove and return the value with its score having the highest score from sorted set atkey.
Blocks connection until element available ortimeoutreached.- Parameters:
key- must not be null.timeout- must not be null.- Returns:
- can be null.
- Throws:
IllegalArgumentException- if the timeout is null or negative.- Since:
- 2.6
- See Also:
-
size
Returns the number of elements of the sorted set stored with givenkey.- Parameters:
key-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zCard
Get the size of sorted set withkey.- Parameters:
key- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 1.3
- See Also:
-
score
Get the score of element withvaluefrom sorted set with keykey.- Parameters:
key- must not be null.value- the value.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
score
Get the scores of elements withvaluesfrom sorted set with keykey.- Parameters:
key- must not be null.o- the values.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
removeRange
Remove elements in range betweenstartandendfrom sorted set withkey.- Parameters:
key- must not be null.start-end-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
removeRangeByLex
Remove elements inRangefrom sorted set with key.- Parameters:
key- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
removeRangeByScore
Remove elements with scores betweenminandmaxfrom sorted set withkey.- Parameters:
key- must not be null.min-max-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
difference
Diff sortedsets.- Parameters:
key- must not be null.otherKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
difference
Diff sortedsets.- Parameters:
key- must not be null.otherKeys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
differenceWithScores
default Set<@NonNull ZSetOperations.TypedTuple<V>> differenceWithScores(@NonNull K key, @NonNull K otherKey) Diff sortedsets.- Parameters:
key- must not be null.otherKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
differenceWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> differenceWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys) Diff sortedsets.- Parameters:
key- must not be null.otherKeys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
differenceAndStore
Long differenceAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey) Diff sortedsetsand store result in destinationdestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
intersect
Intersect sortedsets.- Parameters:
key- must not be null.otherKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
intersect
Intersect sortedsets.- Parameters:
key- must not be null.otherKeys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
intersectWithScores
default Set<@NonNull ZSetOperations.TypedTuple<V>> intersectWithScores(@NonNull K key, @NonNull K otherKey) Intersect sortedsets.- Parameters:
key- must not be null.otherKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
intersectWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> intersectWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys) Intersect sortedsets.- Parameters:
key- must not be null.otherKeys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
intersectWithScores
default Set<ZSetOperations.TypedTuple<V>> intersectWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull Aggregate aggregate) Intersect sorted sets atkeyandotherKeys.- Parameters:
key- must not be null.otherKeys- must not be null.aggregate- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
intersectWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> intersectWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull Aggregate aggregate, @NonNull Weights weights) Intersect sortedsets.- Parameters:
key- must not be null.otherKeys- must not be null.aggregate- must not be null.weights- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
intersectAndStore
Intersect sorted sets atkeyandotherKeyand store result in destinationdestKey.- Parameters:
key- must not be null.otherKey- must not be null.destKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
intersectAndStore
Long intersectAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey) Intersect sorted sets atkeyandotherKeysand store result in destinationdestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
intersectAndStore
default Long intersectAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey, @NonNull Aggregate aggregate) Intersect sorted sets atkeyandotherKeysand store result in destinationdestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.aggregate- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
intersectAndStore
Long intersectAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey, @NonNull Aggregate aggregate, @NonNull Weights weights) Intersect sorted sets atkeyandotherKeysand store result in destinationdestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.aggregate- must not be null.weights- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
union
Union sortedsets.- Parameters:
key- must not be null.otherKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
union
Union sortedsets.- Parameters:
key- must not be null.otherKeys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
unionWithScores
default Set<@NonNull ZSetOperations.TypedTuple<V>> unionWithScores(@NonNull K key, @NonNull K otherKey) Union sortedsets.- Parameters:
key- must not be null.otherKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
unionWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> unionWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys) Union sortedsets.- Parameters:
key- must not be null.otherKeys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
unionWithScores
default Set<@NonNull ZSetOperations.TypedTuple<V>> unionWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull Aggregate aggregate) Union sorted sets atkeyandotherKeys.- Parameters:
key- must not be null.otherKeys- must not be null.aggregate- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
unionWithScores
Set<@NonNull ZSetOperations.TypedTuple<V>> unionWithScores(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull Aggregate aggregate, @NonNull Weights weights) Union sortedsets.- Parameters:
key- must not be null.otherKeys- must not be null.aggregate- must not be null.weights- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
unionAndStore
Union sorted sets atkeyandotherKeysand store result in destinationdestKey.- Parameters:
key- must not be null.otherKey- must not be null.destKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
unionAndStore
Union sorted sets atkeyandotherKeysand store result in destinationdestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
unionAndStore
default Long unionAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey, @NonNull Aggregate aggregate) Union sorted sets atkeyandotherKeysand store result in destinationdestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.aggregate- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
unionAndStore
Long unionAndStore(@NonNull K key, @NonNull Collection<@NonNull K> otherKeys, @NonNull K destKey, @NonNull Aggregate aggregate, @NonNull Weights weights) Union sorted sets atkeyandotherKeysand store result in destinationdestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.aggregate- must not be null.weights- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
scan
@NonNull Cursor<@NonNull ZSetOperations.TypedTuple<V>> scan(@NonNull K key, @Nullable ScanOptions options) Use aCursorto iterate over entries zset atkey.
Important: CallCloseableIterator.close()when done to avoid resource leaks.- Parameters:
key-options- can be null.- Returns:
- the result cursor providing access to the scan result. Must be closed once fully processed (e.g. through a try-with-resources clause).
- Since:
- 1.4
- See Also:
-
rangeByLex
Get all elements with lexicographical ordering from ZSET atkeywith a value betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
key- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
rangeByLex
Get all elements n elements, where n =Limit.getCount(), starting atLimit.getOffset()with lexicographical ordering from ZSET atkeywith a value betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
key- must not be nullrange- must not be null.limit- can be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
reverseRangeByLex
Get all elements with reverse lexicographical ordering from ZSET atkeywith a value betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
key- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
reverseRangeByLex
Get all elements n elements, where n =Limit.getCount(), starting atLimit.getOffset()with reverse lexicographical ordering from ZSET atkeywith a value betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
key- must not be null.range- must not be null.limit- can be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.4
- See Also:
-
rangeAndStoreByLex
Store all elements atdstKeywith lexicographical ordering from ZSET atsrcKeywith a value betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
srcKey- must not be null.dstKey- must not be null.range- must not be null.- Returns:
- the number of stored elements or null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
rangeAndStoreByLex
Long rangeAndStoreByLex(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<String> range, @NonNull Limit limit) Store n elements atdstKey, where n =Limit.getCount(), starting atLimit.getOffset()with lexicographical ordering from ZSET atsrcKeywith a value betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
srcKey- must not be null.dstKey- must not be null.range- must not be null.limit- must not be null.- Returns:
- the number of stored elements or null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
reverseRangeAndStoreByLex
default Long reverseRangeAndStoreByLex(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<String> range) Store all elements atdstKeywith reverse lexicographical ordering from ZSET atsrcKeywith a value betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
srcKey- must not be null.dstKey- must not be null.range- must not be null.- Returns:
- the number of stored elements or null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
reverseRangeAndStoreByLex
Long reverseRangeAndStoreByLex(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<String> range, @NonNull Limit limit) Store n elements atdstKey, where n =Limit.getCount(), starting atLimit.getOffset()with reverse lexicographical ordering from ZSET atsrcKeywith a value betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
srcKey- must not be null.dstKey- must not be null.range- must not be null.limit- must not be null.- Returns:
- the number of stored elements or null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
rangeAndStoreByScore
default Long rangeAndStoreByScore(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<? extends Number> range) Store all elements atdstKeywith ordering by score from ZSET atsrcKeywith a score betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
srcKey- must not be null.dstKey- must not be null.range- must not be null.- Returns:
- the number of stored elements or null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
rangeAndStoreByScore
Long rangeAndStoreByScore(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<? extends Number> range, @NonNull Limit limit) Store n elements atdstKey, where n =Limit.getCount(), starting atLimit.getOffset()with ordering by score from ZSET atsrcKeywith a score betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
srcKey- must not be null.dstKey- must not be null.range- must not be null.limit- must not be null.- Returns:
- the number of stored elements or null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
reverseRangeAndStoreByScore
default Long reverseRangeAndStoreByScore(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<? extends Number> range) Store all elements atdstKeywith reverse ordering by score from ZSET atsrcKeywith a score betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
srcKey- must not be null.dstKey- must not be null.range- must not be null.- Returns:
- the number of stored elements or null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
reverseRangeAndStoreByScore
Long reverseRangeAndStoreByScore(@NonNull K srcKey, @NonNull K dstKey, @NonNull Range<? extends Number> range, @NonNull Limit limit) Store n elements atdstKey, where n =Limit.getCount(), starting atLimit.getOffset()with reverse ordering by score from ZSET atsrcKeywith a score betweenRange.getLowerBound()andRange.getUpperBound().- Parameters:
srcKey- must not be null.dstKey- must not be null.range- must not be null.limit- must not be null.- Returns:
- the number of stored elements or null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
getOperations
@NonNull RedisOperations<K,V> getOperations()- Returns:
- the underlying
RedisOperationsused to execute commands.
-