diff --git a/src/main/java/org/springframework/data/redis/core/BoundZSetOperations.java b/src/main/java/org/springframework/data/redis/core/BoundZSetOperations.java index 9101933a6..62cd5b27e 100644 --- a/src/main/java/org/springframework/data/redis/core/BoundZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/BoundZSetOperations.java @@ -233,36 +233,44 @@ public interface BoundZSetOperations extends BoundKeyOperations { * * @param start * @param end + * @return {@literal null} when used in pipeline / transaction. * @see Redis Documentation: ZREMRANGEBYRANK */ - void removeRange(long start, long end); + @Nullable + Long removeRange(long start, long end); /** * Remove elements with scores between {@code min} and {@code max} from sorted set with the bound key. * * @param min * @param max + * @return {@literal null} when used in pipeline / transaction. * @see Redis Documentation: ZREMRANGEBYSCORE */ - void removeRangeByScore(double min, double max); + @Nullable + Long removeRangeByScore(double min, double max); /** * Union sorted sets at the bound key and {@code otherKeys} and store result in destination {@code destKey}. * * @param otherKey must not be {@literal null}. * @param destKey must not be {@literal null}. + * @return {@literal null} when used in pipeline / transaction. * @see Redis Documentation: ZUNIONSTORE */ - void unionAndStore(K otherKey, K destKey); + @Nullable + Long unionAndStore(K otherKey, K destKey); /** * Union sorted sets at the bound key and {@code otherKeys} and store result in destination {@code destKey}. * * @param otherKeys must not be {@literal null}. * @param destKey must not be {@literal null}. + * @return {@literal null} when used in pipeline / transaction. * @see Redis Documentation: ZUNIONSTORE */ - void unionAndStore(Collection otherKeys, K destKey); + @Nullable + Long unionAndStore(Collection otherKeys, K destKey); /** * Union sorted sets at the bound key and {@code otherKeys} and store result in destination {@code destKey}. @@ -270,10 +278,12 @@ public interface BoundZSetOperations extends BoundKeyOperations { * @param otherKeys must not be {@literal null}. * @param destKey must not be {@literal null}. * @param aggregate must not be {@literal null}. + * @return {@literal null} when used in pipeline / transaction. * @since 2.1 * @see Redis Documentation: ZUNIONSTORE */ - void unionAndStore(Collection otherKeys, K destKey, Aggregate aggregate); + @Nullable + Long unionAndStore(Collection otherKeys, K destKey, Aggregate aggregate); /** * Union sorted sets at the bound key and {@code otherKeys} and store result in destination {@code destKey}. @@ -282,28 +292,34 @@ public interface BoundZSetOperations extends BoundKeyOperations { * @param destKey must not be {@literal null}. * @param aggregate must not be {@literal null}. * @param weights must not be {@literal null}. + * @return {@literal null} when used in pipeline / transaction. * @since 2.1 * @see Redis Documentation: ZUNIONSTORE */ - void unionAndStore(Collection otherKeys, K destKey, Aggregate aggregate, Weights weights); + @Nullable + Long unionAndStore(Collection otherKeys, K destKey, Aggregate aggregate, Weights weights); /** * Intersect sorted sets at the bound key and {@code otherKey} and store result in destination {@code destKey}. * * @param otherKey must not be {@literal null}. * @param destKey must not be {@literal null}. + * @return {@literal null} when used in pipeline / transaction. * @see Redis Documentation: ZINTERSTORE */ - void intersectAndStore(K otherKey, K destKey); + @Nullable + Long intersectAndStore(K otherKey, K destKey); /** * Intersect sorted sets at the bound key and {@code otherKeys} and store result in destination {@code destKey}. * * @param otherKeys must not be {@literal null}. * @param destKey must not be {@literal null}. + * @return {@literal null} when used in pipeline / transaction. * @see Redis Documentation: ZINTERSTORE */ - void intersectAndStore(Collection otherKeys, K destKey); + @Nullable + Long intersectAndStore(Collection otherKeys, K destKey); /** * Intersect sorted sets at the bound key and {@code otherKeys} and store result in destination {@code destKey}. @@ -311,10 +327,12 @@ public interface BoundZSetOperations extends BoundKeyOperations { * @param otherKeys must not be {@literal null}. * @param destKey must not be {@literal null}. * @param aggregate must not be {@literal null}. + * @return {@literal null} when used in pipeline / transaction. * @since 2.1 * @see Redis Documentation: ZINTERSTORE */ - void intersectAndStore(Collection otherKeys, K destKey, Aggregate aggregate); + @Nullable + Long intersectAndStore(Collection otherKeys, K destKey, Aggregate aggregate); /** * Intersect sorted sets at the bound key and {@code otherKeys} and store result in destination {@code destKey}. @@ -323,10 +341,12 @@ public interface BoundZSetOperations extends BoundKeyOperations { * @param destKey must not be {@literal null}. * @param aggregate must not be {@literal null}. * @param weights must not be {@literal null}. + * @return {@literal null} when used in pipeline / transaction. * @since 2.1 * @see Redis Documentation: ZINTERSTORE */ - void intersectAndStore(Collection otherKeys, K destKey, Aggregate aggregate, Weights weights); + @Nullable + Long intersectAndStore(Collection otherKeys, K destKey, Aggregate aggregate, Weights weights); /** * Iterate over elements in zset at the bound key.
diff --git a/src/main/java/org/springframework/data/redis/core/DefaultBoundZSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultBoundZSetOperations.java index a97f456d2..b19cf6f78 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultBoundZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultBoundZSetOperations.java @@ -91,8 +91,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#intersectAndStore(java.lang.Object, java.lang.Object) */ @Override - public void intersectAndStore(K otherKey, K destKey) { - ops.intersectAndStore(getKey(), otherKey, destKey); + public Long intersectAndStore(K otherKey, K destKey) { + return ops.intersectAndStore(getKey(), otherKey, destKey); } /* @@ -100,8 +100,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#intersectAndStore(java.util.Collection, java.lang.Object) */ @Override - public void intersectAndStore(Collection otherKeys, K destKey) { - ops.intersectAndStore(getKey(), otherKeys, destKey); + public Long intersectAndStore(Collection otherKeys, K destKey) { + return ops.intersectAndStore(getKey(), otherKeys, destKey); } /* @@ -109,8 +109,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#intersectAndStore(java.util.Collection, java.lang.Object, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate) */ @Override - public void intersectAndStore(Collection otherKeys, K destKey, Aggregate aggregate) { - ops.intersectAndStore(getKey(), otherKeys, destKey, aggregate); + public Long intersectAndStore(Collection otherKeys, K destKey, Aggregate aggregate) { + return ops.intersectAndStore(getKey(), otherKeys, destKey, aggregate); } /* @@ -118,8 +118,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#intersectAndStore(java.util.Collection, java.lang.Object, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate, org.springframework.data.redis.connection.RedisZSetCommands.Weights) */ @Override - public void intersectAndStore(Collection otherKeys, K destKey, Aggregate aggregate, Weights weights) { - ops.intersectAndStore(getKey(), otherKeys, destKey, aggregate, weights); + public Long intersectAndStore(Collection otherKeys, K destKey, Aggregate aggregate, Weights weights) { + return ops.intersectAndStore(getKey(), otherKeys, destKey, aggregate, weights); } /* @@ -244,8 +244,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#removeRange(long, long) */ @Override - public void removeRange(long start, long end) { - ops.removeRange(getKey(), start, end); + public Long removeRange(long start, long end) { + return ops.removeRange(getKey(), start, end); } /* @@ -253,8 +253,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#removeRangeByScore(double, double) */ @Override - public void removeRangeByScore(double min, double max) { - ops.removeRangeByScore(getKey(), min, max); + public Long removeRangeByScore(double min, double max) { + return ops.removeRangeByScore(getKey(), min, max); } /* @@ -298,8 +298,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#unionAndStore(java.lang.Object, java.lang.Object) */ @Override - public void unionAndStore(K otherKey, K destKey) { - ops.unionAndStore(getKey(), otherKey, destKey); + public Long unionAndStore(K otherKey, K destKey) { + return ops.unionAndStore(getKey(), otherKey, destKey); } /* @@ -307,8 +307,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#unionAndStore(java.util.Collection, java.lang.Object) */ @Override - public void unionAndStore(Collection otherKeys, K destKey) { - ops.unionAndStore(getKey(), otherKeys, destKey); + public Long unionAndStore(Collection otherKeys, K destKey) { + return ops.unionAndStore(getKey(), otherKeys, destKey); } /* @@ -316,8 +316,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#unionAndStore(java.util.Collection, java.lang.Object, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate) */ @Override - public void unionAndStore(Collection otherKeys, K destKey, Aggregate aggregate) { - ops.unionAndStore(getKey(), otherKeys, destKey, aggregate); + public Long unionAndStore(Collection otherKeys, K destKey, Aggregate aggregate) { + return ops.unionAndStore(getKey(), otherKeys, destKey, aggregate); } /* @@ -325,8 +325,8 @@ class DefaultBoundZSetOperations extends DefaultBoundKeyOperations impl * @see org.springframework.data.redis.core.BoundZSetOperations#unionAndStore(java.util.Collection, java.lang.Object, org.springframework.data.redis.connection.RedisZSetCommands.Aggregate, org.springframework.data.redis.connection.RedisZSetCommands.Weights) */ @Override - public void unionAndStore(Collection otherKeys, K destKey, Aggregate aggregate, Weights weights) { - ops.unionAndStore(getKey(), otherKeys, destKey, aggregate, weights); + public Long unionAndStore(Collection otherKeys, K destKey, Aggregate aggregate, Weights weights) { + return ops.unionAndStore(getKey(), otherKeys, destKey, aggregate, weights); } /*