Expose *SCAN commands to BinaryJedis
* method signatures are a bit similar to Jedis's *SCAN ** but it takes parameters to byte[] instead of String * ScanParams : allow match pattern with byte[] * ScanResult : add method to get cursor with byte[] type * *SCAN for BinaryJedis unit tests included
This commit is contained in:
@@ -2,6 +2,8 @@ package redis.clients.jedis;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import redis.clients.util.SafeEncoder;
|
||||
|
||||
public class ScanResult<T> {
|
||||
private String cursor;
|
||||
private List<T> results;
|
||||
@@ -17,6 +19,11 @@ public class ScanResult<T> {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
public ScanResult(byte[] cursor, List<T> results) {
|
||||
this.cursor = SafeEncoder.encode(cursor);
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
public ScanResult(String cursor, List<T> results) {
|
||||
this.cursor = cursor;
|
||||
this.results = results;
|
||||
@@ -40,6 +47,10 @@ public class ScanResult<T> {
|
||||
return cursor;
|
||||
}
|
||||
|
||||
public byte[] getBinaryCursor() {
|
||||
return SafeEncoder.encode(cursor);
|
||||
}
|
||||
|
||||
public List<T> getResult() {
|
||||
return results;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user