Skip to content

Commit def09ea

Browse files
authored
EX param to long (#2399)
Similar to #2396
1 parent 005a2d0 commit def09ea

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/redis/clients/jedis/params/SetParams.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,19 @@ public static SetParams setParams() {
2626
* Set the specified expire time, in seconds.
2727
* @param secondsToExpire
2828
* @return SetParams
29+
* @deprecated Use {@link #ex(long)}.
2930
*/
31+
@Deprecated
3032
public SetParams ex(int secondsToExpire) {
33+
return ex((long) secondsToExpire);
34+
}
35+
36+
/**
37+
* Set the specified expire time, in seconds.
38+
* @param secondsToExpire
39+
* @return SetParams
40+
*/
41+
public SetParams ex(long secondsToExpire) {
3142
addParam(EX, secondsToExpire);
3243
return this;
3344
}
@@ -91,7 +102,7 @@ public byte[][] getByteParams(byte[]... args) {
91102

92103
if (contains(EX)) {
93104
byteParams.add(SafeEncoder.encode(EX));
94-
byteParams.add(Protocol.toByteArray((int) getParam(EX)));
105+
byteParams.add(Protocol.toByteArray((long) getParam(EX)));
95106
}
96107
if (contains(PX)) {
97108
byteParams.add(SafeEncoder.encode(PX));

0 commit comments

Comments
 (0)