Removed deprecated int based weights
This commit is contained in:
@@ -28,25 +28,8 @@ public class ZParams {
|
|||||||
*
|
*
|
||||||
* @param weights
|
* @param weights
|
||||||
* weights.
|
* weights.
|
||||||
* @deprecated Use {@link #weightsByDouble(double...)} instead
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
public ZParams weights(final double... weights) {
|
||||||
public ZParams weights(final int... weights) {
|
|
||||||
params.add(WEIGHTS.raw);
|
|
||||||
for (final int weight : weights) {
|
|
||||||
params.add(Protocol.toByteArray(weight));
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set weights.
|
|
||||||
*
|
|
||||||
* @param weights
|
|
||||||
* weights.
|
|
||||||
*/
|
|
||||||
public ZParams weightsByDouble(final double... weights) {
|
|
||||||
params.add(WEIGHTS.raw);
|
params.add(WEIGHTS.raw);
|
||||||
for (final double weight : weights) {
|
for (final double weight : weights) {
|
||||||
params.add(Protocol.toByteArray(weight));
|
params.add(Protocol.toByteArray(weight));
|
||||||
|
|||||||
@@ -783,7 +783,7 @@ public class SortedSetCommandsTest extends JedisCommandTestBase {
|
|||||||
jedis.zadd("bar", 2, "b");
|
jedis.zadd("bar", 2, "b");
|
||||||
|
|
||||||
ZParams params = new ZParams();
|
ZParams params = new ZParams();
|
||||||
params.weightsByDouble(2, 2.5);
|
params.weights(2, 2.5);
|
||||||
params.aggregate(ZParams.Aggregate.SUM);
|
params.aggregate(ZParams.Aggregate.SUM);
|
||||||
long result = jedis.zunionstore("dst", params, "foo", "bar");
|
long result = jedis.zunionstore("dst", params, "foo", "bar");
|
||||||
|
|
||||||
@@ -802,7 +802,7 @@ public class SortedSetCommandsTest extends JedisCommandTestBase {
|
|||||||
jedis.zadd(bbar, 2, bb);
|
jedis.zadd(bbar, 2, bb);
|
||||||
|
|
||||||
ZParams bparams = new ZParams();
|
ZParams bparams = new ZParams();
|
||||||
bparams.weightsByDouble(2, 2.5);
|
bparams.weights(2, 2.5);
|
||||||
bparams.aggregate(ZParams.Aggregate.SUM);
|
bparams.aggregate(ZParams.Aggregate.SUM);
|
||||||
long bresult = jedis.zunionstore(SafeEncoder.encode("dst"), bparams,
|
long bresult = jedis.zunionstore(SafeEncoder.encode("dst"), bparams,
|
||||||
bfoo, bbar);
|
bfoo, bbar);
|
||||||
@@ -855,7 +855,7 @@ public class SortedSetCommandsTest extends JedisCommandTestBase {
|
|||||||
jedis.zadd("bar", 2, "a");
|
jedis.zadd("bar", 2, "a");
|
||||||
|
|
||||||
ZParams params = new ZParams();
|
ZParams params = new ZParams();
|
||||||
params.weightsByDouble(2, 2.5);
|
params.weights(2, 2.5);
|
||||||
params.aggregate(ZParams.Aggregate.SUM);
|
params.aggregate(ZParams.Aggregate.SUM);
|
||||||
long result = jedis.zinterstore("dst", params, "foo", "bar");
|
long result = jedis.zinterstore("dst", params, "foo", "bar");
|
||||||
|
|
||||||
@@ -872,7 +872,7 @@ public class SortedSetCommandsTest extends JedisCommandTestBase {
|
|||||||
jedis.zadd(bbar, 2, ba);
|
jedis.zadd(bbar, 2, ba);
|
||||||
|
|
||||||
ZParams bparams = new ZParams();
|
ZParams bparams = new ZParams();
|
||||||
bparams.weightsByDouble(2, 2.5);
|
bparams.weights(2, 2.5);
|
||||||
bparams.aggregate(ZParams.Aggregate.SUM);
|
bparams.aggregate(ZParams.Aggregate.SUM);
|
||||||
long bresult = jedis.zinterstore(SafeEncoder.encode("dst"), bparams,
|
long bresult = jedis.zinterstore(SafeEncoder.encode("dst"), bparams,
|
||||||
bfoo, bbar);
|
bfoo, bbar);
|
||||||
|
|||||||
Reference in New Issue
Block a user