File tree 3 files changed +13
-3
lines changed
src/main/java/redis/clients/jedis/params
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public byte[][] getByteParams(byte[]... args) {
65
65
66
66
if (contains (COUNT )) {
67
67
byteParams .add (SafeEncoder .encode (COUNT ));
68
- byteParams .add (Protocol .toByteArray ((Integer ) getParam (COUNT )));
68
+ byteParams .add (Protocol .toByteArray ((int ) getParam (COUNT )));
69
69
}
70
70
71
71
if (contains (ASC )) {
Original file line number Diff line number Diff line change 5
5
import java .util .Map ;
6
6
import java .util .Map .Entry ;
7
7
8
+ import redis .clients .jedis .Protocol ;
8
9
import redis .clients .jedis .util .SafeEncoder ;
9
10
10
11
public abstract class Params {
@@ -29,6 +30,14 @@ public byte[][] getByteParams() {
29
30
if (value != null ) {
30
31
if (value instanceof byte []) {
31
32
byteParams .add ((byte []) value );
33
+ } else if (value instanceof Boolean ) {
34
+ byteParams .add (Protocol .toByteArray ((boolean ) value ));
35
+ } else if (value instanceof Integer ) {
36
+ byteParams .add (Protocol .toByteArray ((int ) value ));
37
+ } else if (value instanceof Long ) {
38
+ byteParams .add (Protocol .toByteArray ((long ) value ));
39
+ } else if (value instanceof Double ) {
40
+ byteParams .add (Protocol .toByteArray ((double ) value ));
32
41
} else {
33
42
byteParams .add (SafeEncoder .encode (String .valueOf (value )));
34
43
}
Original file line number Diff line number Diff line change 2
2
3
3
import java .util .ArrayList ;
4
4
5
+ import redis .clients .jedis .Protocol ;
5
6
import redis .clients .jedis .util .SafeEncoder ;
6
7
7
8
public class SetParams extends Params {
@@ -71,11 +72,11 @@ public byte[][] getByteParams(byte[]... args) {
71
72
72
73
if (contains (EX )) {
73
74
byteParams .add (SafeEncoder .encode (EX ));
74
- byteParams .add (SafeEncoder . encode ( String . valueOf ( getParam (EX ) )));
75
+ byteParams .add (Protocol . toByteArray (( int ) getParam (EX )));
75
76
}
76
77
if (contains (PX )) {
77
78
byteParams .add (SafeEncoder .encode (PX ));
78
- byteParams .add (SafeEncoder . encode ( String . valueOf ( getParam (PX ) )));
79
+ byteParams .add (Protocol . toByteArray (( long ) getParam (PX )));
79
80
}
80
81
81
82
return byteParams .toArray (new byte [byteParams .size ()][]);
You can’t perform that action at this time.
0 commit comments