public interface ZSetOperations<K,V>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ZSetOperations.TypedTuple<V>
Typed ZSet tuple.
|
| Modifier and Type | Method and Description |
|---|---|
Long |
add(K key,
Set<ZSetOperations.TypedTuple<V>> tuples)
Add
tuples to a sorted set at key, or update its score if it already exists. |
Boolean |
add(K key,
V value,
double score)
Add
value to a sorted set at key, or update its score if it already exists. |
Long |
addIfAbsent(K key,
Set<ZSetOperations.TypedTuple<V>> tuples)
Add
tuples to a sorted set at key if it does not already exists. |
Boolean |
addIfAbsent(K key,
V value,
double score)
Add
value to a sorted set at key if it does not already exists. |
Long |
count(K key,
double min,
double max)
Count number of elements within sorted set with scores between
min and max. |
Set<V> |
difference(K key,
Collection<K> otherKeys)
Diff sorted
sets. |
default Set<V> |
difference(K key,
K otherKey)
Diff sorted
sets. |
Long |
differenceAndStore(K key,
Collection<K> otherKeys,
K destKey)
Diff sorted
sets and store result in destination destKey. |
Set<ZSetOperations.TypedTuple<V>> |
differenceWithScores(K key,
Collection<K> otherKeys)
Diff sorted
sets. |
default Set<ZSetOperations.TypedTuple<V>> |
differenceWithScores(K key,
K otherKey)
Diff sorted
sets. |
Set<V> |
distinctRandomMembers(K key,
long count)
Get
count distinct random elements from set at key. |
Set<ZSetOperations.TypedTuple<V>> |
distinctRandomMembersWithScore(K key,
long count)
Get
count distinct random elements with their score from set at key. |
RedisOperations<K,V> |
getOperations() |
Double |
incrementScore(K key,
V value,
double delta)
Increment the score of element with
value in sorted set by increment. |
Set<V> |
intersect(K key,
Collection<K> otherKeys)
Intersect sorted
sets. |
default Set<V> |
intersect(K key,
K otherKey)
Intersect sorted
sets. |
Long |
intersectAndStore(K key,
Collection<K> otherKeys,
K destKey)
Intersect sorted sets at
key and otherKeys and store result in destination destKey. |
default Long |
intersectAndStore(K key,
Collection<K> otherKeys,
K destKey,
RedisZSetCommands.Aggregate aggregate)
Intersect sorted sets at
key and otherKeys and store result in destination destKey. |
Long |
intersectAndStore(K key,
Collection<K> otherKeys,
K destKey,
RedisZSetCommands.Aggregate aggregate,
RedisZSetCommands.Weights weights)
Intersect sorted sets at
key and otherKeys and store result in destination destKey. |
Long |
intersectAndStore(K key,
K otherKey,
K destKey)
Intersect sorted sets at
key and otherKey and store result in destination destKey. |
Set<ZSetOperations.TypedTuple<V>> |
intersectWithScores(K key,
Collection<K> otherKeys)
Intersect sorted
sets. |
default Set<ZSetOperations.TypedTuple<V>> |
intersectWithScores(K key,
Collection<K> otherKeys,
RedisZSetCommands.Aggregate aggregate)
Intersect sorted sets at
key and otherKeys . |
Set<ZSetOperations.TypedTuple<V>> |
intersectWithScores(K key,
Collection<K> otherKeys,
RedisZSetCommands.Aggregate aggregate,
RedisZSetCommands.Weights weights)
Intersect sorted
sets. |
default Set<ZSetOperations.TypedTuple<V>> |
intersectWithScores(K key,
K otherKey)
Intersect sorted
sets. |
Long |
lexCount(K key,
RedisZSetCommands.Range range)
Count number of elements within sorted set with value between
Range#min and Range#max applying
lexicographical ordering. |
ZSetOperations.TypedTuple<V> |
popMax(K key)
Remove and return the value with its score having the highest score from sorted set at
key. |
default ZSetOperations.TypedTuple<V> |
popMax(K key,
Duration timeout)
Remove and return the value with its score having the highest score from sorted set at
key. |
Set<ZSetOperations.TypedTuple<V>> |
popMax(K key,
long count)
Remove and return
count values with their score having the highest score from sorted set at key. |
ZSetOperations.TypedTuple<V> |
popMax(K key,
long timeout,
TimeUnit unit)
Remove and return the value with its score having the highest score from sorted set at
key. |
ZSetOperations.TypedTuple<V> |
popMin(K key)
Remove and return the value with its score having the lowest score from sorted set at
key. |
default ZSetOperations.TypedTuple<V> |
popMin(K key,
Duration timeout)
Remove and return the value with its score having the lowest score from sorted set at
key. |
Set<ZSetOperations.TypedTuple<V>> |
popMin(K key,
long count)
Remove and return
count values with their score having the lowest score from sorted set at key. |
ZSetOperations.TypedTuple<V> |
popMin(K key,
long timeout,
TimeUnit unit)
Remove and return the value with its score having the lowest score from sorted set at
key. |
V |
randomMember(K key)
Get random element from set at
key. |
List<V> |
randomMembers(K key,
long count)
Get
count random elements from set at key. |
List<ZSetOperations.TypedTuple<V>> |
randomMembersWithScore(K key,
long count)
Get
count random elements with their score from set at key. |
ZSetOperations.TypedTuple<V> |
randomMemberWithScore(K key)
Get random element with its score from set at
key. |
Set<V> |
range(K key,
long start,
long end)
Get elements between
start and end from sorted set. |
default Set<V> |
rangeByLex(K key,
RedisZSetCommands.Range range)
Get all elements with lexicographical ordering from ZSET at
key with a value between
RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax(). |
Set<V> |
rangeByLex(K key,
RedisZSetCommands.Range range,
RedisZSetCommands.Limit limit)
Get all elements n elements, where n =
RedisZSetCommands.Limit.getCount(), starting at
RedisZSetCommands.Limit.getOffset() with lexicographical ordering from ZSET at key with a value between
RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax(). |
Set<V> |
rangeByScore(K key,
double min,
double max)
Get elements where score is between
min and max from sorted set. |
Set<V> |
rangeByScore(K key,
double min,
double max,
long offset,
long count)
Get elements in range from
start to end where score is between min and max from
sorted set. |
Set<ZSetOperations.TypedTuple<V>> |
rangeByScoreWithScores(K key,
double min,
double max)
|
Set<ZSetOperations.TypedTuple<V>> |
rangeByScoreWithScores(K key,
double min,
double max,
long offset,
long count)
Get set of
RedisZSetCommands.Tuples in range from start to end where score is between min and
max from sorted set. |
Set<ZSetOperations.TypedTuple<V>> |
rangeWithScores(K key,
long start,
long end)
|
Long |
rank(K key,
Object o)
Determine the index of element with
value in a sorted set. |
Long |
remove(K key,
Object... values)
Remove
values from sorted set. |
Long |
removeRange(K key,
long start,
long end)
Remove elements in range between
start and end from sorted set with key. |
Long |
removeRangeByLex(K key,
RedisZSetCommands.Range range)
Remove elements in
RedisZSetCommands.Range from sorted set with key. |
Long |
removeRangeByScore(K key,
double min,
double max)
Remove elements with scores between
min and max from sorted set with key. |
Set<V> |
reverseRange(K key,
long start,
long end)
Get elements in range from
start to end from sorted set ordered from high to low. |
default Set<V> |
reverseRangeByLex(K key,
RedisZSetCommands.Range range)
Get all elements with reverse lexicographical ordering from ZSET at
key with a value between
RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax(). |
Set<V> |
reverseRangeByLex(K key,
RedisZSetCommands.Range range,
RedisZSetCommands.Limit limit)
Get all elements n elements, where n =
RedisZSetCommands.Limit.getCount(), starting at
RedisZSetCommands.Limit.getOffset() with reverse lexicographical ordering from ZSET at key with a value
between RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax(). |
Set<V> |
reverseRangeByScore(K key,
double min,
double max)
Get elements where score is between
min and max from sorted set ordered from high to low. |
Set<V> |
reverseRangeByScore(K key,
double min,
double max,
long offset,
long count)
Get elements in range from
start to end where score is between min and max from
sorted set ordered high -> low. |
Set<ZSetOperations.TypedTuple<V>> |
reverseRangeByScoreWithScores(K key,
double min,
double max)
Get set of
RedisZSetCommands.Tuple where score is between min and max from sorted set ordered from high to
low. |
Set<ZSetOperations.TypedTuple<V>> |
reverseRangeByScoreWithScores(K key,
double min,
double max,
long offset,
long count)
Get set of
RedisZSetCommands.Tuple in range from start to end where score is between min and
max from sorted set ordered high -> low. |
Set<ZSetOperations.TypedTuple<V>> |
reverseRangeWithScores(K key,
long start,
long end)
Get set of
RedisZSetCommands.Tuples in range from start to end from sorted set ordered from high to low. |
Long |
reverseRank(K key,
Object o)
Determine the index of element with
value in a sorted set when scored high to low. |
Cursor<ZSetOperations.TypedTuple<V>> |
scan(K key,
ScanOptions options)
Iterate over elements in zset at
key. |
List<Double> |
score(K key,
Object... o)
Get the scores of elements with
values from sorted set with key key. |
Double |
score(K key,
Object o)
Get the score of element with
value from sorted set with key key. |
Long |
size(K key)
Returns the number of elements of the sorted set stored with given
key. |
Set<V> |
union(K key,
Collection<K> otherKeys)
Union sorted
sets. |
default Set<V> |
union(K key,
K otherKey)
Union sorted
sets. |
Long |
unionAndStore(K key,
Collection<K> otherKeys,
K destKey)
Union sorted sets at
key and otherKeys and store result in destination destKey. |
default Long |
unionAndStore(K key,
Collection<K> otherKeys,
K destKey,
RedisZSetCommands.Aggregate aggregate)
Union sorted sets at
key and otherKeys and store result in destination destKey. |
Long |
unionAndStore(K key,
Collection<K> otherKeys,
K destKey,
RedisZSetCommands.Aggregate aggregate,
RedisZSetCommands.Weights weights)
Union sorted sets at
key and otherKeys and store result in destination destKey. |
Long |
unionAndStore(K key,
K otherKey,
K destKey)
Union sorted sets at
key and otherKeys and store result in destination destKey. |
Set<ZSetOperations.TypedTuple<V>> |
unionWithScores(K key,
Collection<K> otherKeys)
Union sorted
sets. |
default Set<ZSetOperations.TypedTuple<V>> |
unionWithScores(K key,
Collection<K> otherKeys,
RedisZSetCommands.Aggregate aggregate)
Union sorted sets at
key and otherKeys . |
Set<ZSetOperations.TypedTuple<V>> |
unionWithScores(K key,
Collection<K> otherKeys,
RedisZSetCommands.Aggregate aggregate,
RedisZSetCommands.Weights weights)
Union sorted
sets. |
default Set<ZSetOperations.TypedTuple<V>> |
unionWithScores(K key,
K otherKey)
Union sorted
sets. |
Long |
zCard(K key)
Get the size of sorted set with
key. |
@Nullable Boolean add(K key, V value, double score)
value to a sorted set at key, or update its score if it already exists.key - must not be null.score - the score.value - the value.@Nullable Boolean addIfAbsent(K key, V value, double score)
value to a sorted set at key if it does not already exists.key - must not be null.score - the score.value - the value.@Nullable Long add(K key, Set<ZSetOperations.TypedTuple<V>> tuples)
tuples to a sorted set at key, or update its score if it already exists.key - must not be null.tuples - must not be null.@Nullable Long addIfAbsent(K key, Set<ZSetOperations.TypedTuple<V>> tuples)
tuples to a sorted set at key if it does not already exists.key - must not be null.tuples - must not be null.@Nullable Long remove(K key, Object... values)
values from sorted set. Return number of removed elements.key - must not be null.values - must not be null.@Nullable Double incrementScore(K key, V value, double delta)
value in sorted set by increment.key - must not be null.delta - value - the value.V randomMember(K key)
key.key - must not be null.@Nullable Set<V> distinctRandomMembers(K key, long count)
count distinct random elements from set at key.key - must not be null.count - nr of members to returnSet if key does not exist.IllegalArgumentException - if count is negative.@Nullable List<V> randomMembers(K key, long count)
count random elements from set at key.key - must not be null.count - nr of members to return.List if key does not exist or null when used in pipeline / transaction.IllegalArgumentException - if count is negative.ZSetOperations.TypedTuple<V> randomMemberWithScore(K key)
key.key - must not be null.@Nullable Set<ZSetOperations.TypedTuple<V>> distinctRandomMembersWithScore(K key, long count)
count distinct random elements with their score from set at key.key - must not be null.count - nr of members to returnSet if key does not exist.IllegalArgumentException - if count is negative.@Nullable List<ZSetOperations.TypedTuple<V>> randomMembersWithScore(K key, long count)
count random elements with their score from set at key.key - must not be null.count - nr of members to return.List if key does not exist or null when used in pipeline / transaction.IllegalArgumentException - if count is negative.@Nullable Long rank(K key, Object o)
value in a sorted set.key - must not be null.o - the value.@Nullable Long reverseRank(K key, Object o)
value in a sorted set when scored high to low.key - must not be null.o - the value.@Nullable Set<V> range(K key, long start, long end)
start and end from sorted set.key - must not be null.start - end - @Nullable Set<ZSetOperations.TypedTuple<V>> rangeWithScores(K key, long start, long end)
key - must not be null.start - end - @Nullable Set<V> rangeByScore(K key, double min, double max)
min and max from sorted set.key - must not be null.min - max - @Nullable Set<ZSetOperations.TypedTuple<V>> rangeByScoreWithScores(K key, double min, double max)
key - must not be null.min - max - @Nullable Set<V> rangeByScore(K key, double min, double max, long offset, long count)
start to end where score is between min and max from
sorted set.key - must not be null.min - max - offset - count - @Nullable Set<ZSetOperations.TypedTuple<V>> rangeByScoreWithScores(K key, double min, double max, long offset, long count)
RedisZSetCommands.Tuples in range from start to end where score is between min and
max from sorted set.key - min - max - offset - count - @Nullable Set<V> reverseRange(K key, long start, long end)
start to end from sorted set ordered from high to low.key - must not be null.start - end - @Nullable Set<ZSetOperations.TypedTuple<V>> reverseRangeWithScores(K key, long start, long end)
RedisZSetCommands.Tuples in range from start to end from sorted set ordered from high to low.key - must not be null.start - end - @Nullable Set<V> reverseRangeByScore(K key, double min, double max)
min and max from sorted set ordered from high to low.key - must not be null.min - max - @Nullable Set<ZSetOperations.TypedTuple<V>> reverseRangeByScoreWithScores(K key, double min, double max)
RedisZSetCommands.Tuple where score is between min and max from sorted set ordered from high to
low.key - must not be null.min - max - @Nullable Set<V> reverseRangeByScore(K key, double min, double max, long offset, long count)
start to end where score is between min and max from
sorted set ordered high -> low.key - must not be null.min - max - offset - count - @Nullable Set<ZSetOperations.TypedTuple<V>> reverseRangeByScoreWithScores(K key, double min, double max, long offset, long count)
RedisZSetCommands.Tuple in range from start to end where score is between min and
max from sorted set ordered high -> low.key - must not be null.min - max - offset - count - @Nullable Long count(K key, double min, double max)
min and max.key - must not be null.min - max - @Nullable Long lexCount(K key, RedisZSetCommands.Range range)
Range#min and Range#max applying
lexicographical ordering.key - must not be null.range - must not be null.@Nullable ZSetOperations.TypedTuple<V> popMin(K key)
key.key - must not be null.@Nullable Set<ZSetOperations.TypedTuple<V>> popMin(K key, long count)
count values with their score having the lowest score from sorted set at key.key - must not be null.count - number of elements to pop.@Nullable ZSetOperations.TypedTuple<V> popMin(K key, long timeout, TimeUnit unit)
key. timeout reached.key - must not be null.timeout - unit - must not be null.@Nullable default ZSetOperations.TypedTuple<V> popMin(K key, Duration timeout)
key. timeout reached.key - must not be null.timeout - must not be null.IllegalArgumentException - if the timeout is null or negative.@Nullable ZSetOperations.TypedTuple<V> popMax(K key)
key.key - must not be null.@Nullable Set<ZSetOperations.TypedTuple<V>> popMax(K key, long count)
count values with their score having the highest score from sorted set at key.key - must not be null.count - number of elements to pop.@Nullable ZSetOperations.TypedTuple<V> popMax(K key, long timeout, TimeUnit unit)
key. timeout reached.key - must not be null.timeout - unit - must not be null.@Nullable default ZSetOperations.TypedTuple<V> popMax(K key, Duration timeout)
key. timeout reached.key - must not be null.timeout - must not be null.IllegalArgumentException - if the timeout is null or negative.@Nullable Long size(K key)
key.key - zCard(Object),
Redis Documentation: ZCARD@Nullable Long zCard(K key)
key.key - must not be null.@Nullable Double score(K key, Object o)
value from sorted set with key key.key - must not be null.o - the value.@Nullable List<Double> score(K key, Object... o)
values from sorted set with key key.key - must not be null.o - the values.@Nullable Long removeRange(K key, long start, long end)
start and end from sorted set with key.key - must not be null.start - end - @Nullable Long removeRangeByLex(K key, RedisZSetCommands.Range range)
RedisZSetCommands.Range from sorted set with key.key - must not be null.range - must not be null.@Nullable Long removeRangeByScore(K key, double min, double max)
min and max from sorted set with key.key - must not be null.min - max - @Nullable default Set<V> difference(K key, K otherKey)
sets.key - must not be null.otherKey - must not be null.@Nullable Set<V> difference(K key, Collection<K> otherKeys)
sets.key - must not be null.otherKeys - must not be null.@Nullable default Set<ZSetOperations.TypedTuple<V>> differenceWithScores(K key, K otherKey)
sets.key - must not be null.otherKey - must not be null.@Nullable Set<ZSetOperations.TypedTuple<V>> differenceWithScores(K key, Collection<K> otherKeys)
sets.key - must not be null.otherKeys - must not be null.@Nullable Long differenceAndStore(K key, Collection<K> otherKeys, K destKey)
sets and store result in destination destKey.key - must not be null.otherKeys - must not be null.destKey - must not be null.@Nullable default Set<V> intersect(K key, K otherKey)
sets.key - must not be null.otherKey - must not be null.@Nullable Set<V> intersect(K key, Collection<K> otherKeys)
sets.key - must not be null.otherKeys - must not be null.@Nullable default Set<ZSetOperations.TypedTuple<V>> intersectWithScores(K key, K otherKey)
sets.key - must not be null.otherKey - must not be null.@Nullable Set<ZSetOperations.TypedTuple<V>> intersectWithScores(K key, Collection<K> otherKeys)
sets.key - must not be null.otherKeys - must not be null.@Nullable default Set<ZSetOperations.TypedTuple<V>> intersectWithScores(K key, Collection<K> otherKeys, RedisZSetCommands.Aggregate aggregate)
key and otherKeys .key - must not be null.otherKeys - must not be null.aggregate - must not be null.@Nullable Set<ZSetOperations.TypedTuple<V>> intersectWithScores(K key, Collection<K> otherKeys, RedisZSetCommands.Aggregate aggregate, RedisZSetCommands.Weights weights)
sets.key - must not be null.otherKeys - must not be null.aggregate - must not be null.weights - must not be null.@Nullable Long intersectAndStore(K key, K otherKey, K destKey)
key and otherKey and store result in destination destKey.key - must not be null.otherKey - must not be null.destKey - must not be null.@Nullable Long intersectAndStore(K key, Collection<K> otherKeys, K destKey)
key and otherKeys and store result in destination destKey.key - must not be null.otherKeys - must not be null.destKey - must not be null.@Nullable default Long intersectAndStore(K key, Collection<K> otherKeys, K destKey, RedisZSetCommands.Aggregate aggregate)
key and otherKeys and store result in destination destKey.key - must not be null.otherKeys - must not be null.destKey - must not be null.aggregate - must not be null.@Nullable Long intersectAndStore(K key, Collection<K> otherKeys, K destKey, RedisZSetCommands.Aggregate aggregate, RedisZSetCommands.Weights weights)
key and otherKeys and store result in destination destKey.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.@Nullable default Set<V> union(K key, K otherKey)
sets.key - must not be null.otherKey - must not be null.@Nullable Set<V> union(K key, Collection<K> otherKeys)
sets.key - must not be null.otherKeys - must not be null.@Nullable default Set<ZSetOperations.TypedTuple<V>> unionWithScores(K key, K otherKey)
sets.key - must not be null.otherKey - must not be null.@Nullable Set<ZSetOperations.TypedTuple<V>> unionWithScores(K key, Collection<K> otherKeys)
sets.key - must not be null.otherKeys - must not be null.@Nullable default Set<ZSetOperations.TypedTuple<V>> unionWithScores(K key, Collection<K> otherKeys, RedisZSetCommands.Aggregate aggregate)
key and otherKeys .key - must not be null.otherKeys - must not be null.aggregate - must not be null.@Nullable Set<ZSetOperations.TypedTuple<V>> unionWithScores(K key, Collection<K> otherKeys, RedisZSetCommands.Aggregate aggregate, RedisZSetCommands.Weights weights)
sets.key - must not be null.otherKeys - must not be null.aggregate - must not be null.weights - must not be null.@Nullable Long unionAndStore(K key, K otherKey, K destKey)
key and otherKeys and store result in destination destKey.key - must not be null.otherKey - must not be null.destKey - must not be null.@Nullable Long unionAndStore(K key, Collection<K> otherKeys, K destKey)
key and otherKeys and store result in destination destKey.key - must not be null.otherKeys - must not be null.destKey - must not be null.@Nullable default Long unionAndStore(K key, Collection<K> otherKeys, K destKey, RedisZSetCommands.Aggregate aggregate)
key and otherKeys and store result in destination destKey.key - must not be null.otherKeys - must not be null.destKey - must not be null.aggregate - must not be null.@Nullable Long unionAndStore(K key, Collection<K> otherKeys, K destKey, RedisZSetCommands.Aggregate aggregate, RedisZSetCommands.Weights weights)
key and otherKeys and store result in destination destKey.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.Cursor<ZSetOperations.TypedTuple<V>> scan(K key, ScanOptions options)
key. CloseableIterator.close() when done to avoid resource leak.key - options - @Nullable default Set<V> rangeByLex(K key, RedisZSetCommands.Range range)
key with a value between
RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax().key - must not be null.range - must not be null.@Nullable Set<V> rangeByLex(K key, RedisZSetCommands.Range range, RedisZSetCommands.Limit limit)
RedisZSetCommands.Limit.getCount(), starting at
RedisZSetCommands.Limit.getOffset() with lexicographical ordering from ZSET at key with a value between
RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax().key - must not be nullrange - must not be null.limit - can be null.@Nullable default Set<V> reverseRangeByLex(K key, RedisZSetCommands.Range range)
key with a value between
RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax().key - must not be null.range - must not be null.@Nullable Set<V> reverseRangeByLex(K key, RedisZSetCommands.Range range, RedisZSetCommands.Limit limit)
RedisZSetCommands.Limit.getCount(), starting at
RedisZSetCommands.Limit.getOffset() with reverse lexicographical ordering from ZSET at key with a value
between RedisZSetCommands.Range.getMin() and RedisZSetCommands.Range.getMax().key - must not be nullrange - must not be null.limit - can be null.RedisOperations<K,V> getOperations()
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.