Merge branch 'master' of https://github.com/markus-s24/jedis into markus-s24-master
This commit is contained in:
@@ -23,6 +23,14 @@ public class ZParams {
|
||||
|
||||
private List<byte[]> params = new ArrayList<byte[]>();
|
||||
|
||||
/**
|
||||
* Set weights.
|
||||
*
|
||||
* @param weights
|
||||
* weights.
|
||||
* @deprecated Use {@link #weightsByDouble(double...)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public ZParams weights(final int... weights) {
|
||||
params.add(WEIGHTS.raw);
|
||||
for (final int weight : weights) {
|
||||
@@ -32,6 +40,21 @@ public class ZParams {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set weights.
|
||||
*
|
||||
* @param weights
|
||||
* weights.
|
||||
*/
|
||||
public ZParams weightsByDouble(final double... weights) {
|
||||
params.add(WEIGHTS.raw);
|
||||
for (final double weight : weights) {
|
||||
params.add(Protocol.toByteArray(weight));
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public Collection<byte[]> getParams() {
|
||||
return Collections.unmodifiableCollection(params);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user