Implemented all the sorting parameters
This commit is contained in:
@@ -399,4 +399,18 @@ public class Client extends Connection {
|
||||
public void blpop(String[] args) throws JedisException {
|
||||
sendCommand("BLPOP", args);
|
||||
}
|
||||
|
||||
public void sort(String key, SortingParams sortingParameters, String dstkey)
|
||||
throws JedisException {
|
||||
List<String> args = new ArrayList<String>();
|
||||
args.add(key);
|
||||
args.addAll(sortingParameters.getParams());
|
||||
args.add("STORE");
|
||||
args.add(dstkey);
|
||||
sendCommand("SORT", args.toArray(new String[args.size()]));
|
||||
}
|
||||
|
||||
public void sort(String key, String dstkey) throws JedisException {
|
||||
sendCommand("SORT", key, "STORE", dstkey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,4 +519,15 @@ public class Jedis {
|
||||
client.blpop(args.toArray(new String[args.size()]));
|
||||
return client.getMultiBulkReply();
|
||||
}
|
||||
|
||||
public int sort(String key, SortingParams sortingParameters, String dstkey)
|
||||
throws JedisException {
|
||||
client.sort(key, sortingParameters, dstkey);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
|
||||
public int sort(String key, String dstkey) throws JedisException {
|
||||
client.sort(key, dstkey);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user