Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
* @author Andrey Shlykov
* @author Shyngys Sapraliyev
* @author John Blum
* @author Gunha Hwang
*/
@NullUnmarked
class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZSetOperations<K, V> {
Expand Down Expand Up @@ -349,10 +350,10 @@ public Set<TypedTuple<V>> reverseRangeByScoreWithScores(@NonNull K key, double m
}

@Override
public Long rank(@NonNull K key, @NonNull Object o) {
public Long rank(@NonNull K key, @NonNull Object value) {

byte[] rawKey = rawKey(key);
byte[] rawValue = rawValue(o);
byte[] rawValue = rawValue(value);

return execute(connection -> {
Long zRank = connection.zRank(rawKey, rawValue);
Expand All @@ -361,10 +362,10 @@ public Long rank(@NonNull K key, @NonNull Object o) {
}

@Override
public Long reverseRank(@NonNull K key, @NonNull Object o) {
public Long reverseRank(@NonNull K key, @NonNull Object value) {

byte[] rawKey = rawKey(key);
byte[] rawValue = rawValue(o);
byte[] rawValue = rawValue(value);

return execute(connection -> {
Long zRank = connection.zRevRank(rawKey, rawValue);
Expand Down Expand Up @@ -406,10 +407,10 @@ public Long removeRangeByScore(@NonNull K key, double min, double max) {
}

@Override
public Double score(@NonNull K key, Object o) {
public Double score(@NonNull K key, Object value) {

byte[] rawKey = rawKey(key);
byte[] rawValue = rawValue(o);
byte[] rawValue = rawValue(value);

return execute(connection -> connection.zScore(rawKey, rawValue));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* @author Wongoo (望哥)
* @author Andrey Shlykov
* @author Shyngys Sapraliyev
* @author Gunha Hwang
*/
@NullUnmarked
public interface ZSetOperations<K, V> {
Expand Down Expand Up @@ -210,21 +211,21 @@ static <V> TypedTuple<V> of(@NonNull V value, @Nullable Double score) {
* Determine the index of element with {@code value} in a sorted set.
*
* @param key must not be {@literal null}.
* @param o the value.
* @param value the value.
* @return {@literal null} when used in pipeline / transaction.
* @see <a href="https://redis.io/commands/zrank">Redis Documentation: ZRANK</a>
*/
Long rank(@NonNull K key, @NonNull Object o);
Long rank(@NonNull K key, @NonNull Object value);

/**
* Determine the index of element with {@code value} in a sorted set when scored high to low.
*
* @param key must not be {@literal null}.
* @param o the value.
* @param value the value.
* @return {@literal null} when used in pipeline / transaction.
* @see <a href="https://redis.io/commands/zrevrank">Redis Documentation: ZREVRANK</a>
*/
Long reverseRank(@NonNull K key, @NonNull Object o);
Long reverseRank(@NonNull K key, @NonNull Object value);

/**
* Get elements between {@code start} and {@code end} from sorted set.
Expand Down Expand Up @@ -525,11 +526,11 @@ default TypedTuple<V> popMax(@NonNull K key, @NonNull Duration timeout) {
* Get the score of element with {@code value} from sorted set with key {@code key}.
*
* @param key must not be {@literal null}.
* @param o the value.
* @param value the value.
* @return {@literal null} when used in pipeline / transaction.
* @see <a href="https://redis.io/commands/zscore">Redis Documentation: ZSCORE</a>
*/
Double score(@NonNull K key, Object o);
Double score(@NonNull K key, Object value);

/**
* Get the scores of elements with {@code values} from sorted set with key {@code key}.
Expand Down