Fixing Jedis.(get|set)bit to use use booleans as input and output to better match Redis commands
This commit is contained in:
committed by
Jonathan Leibiusky
parent
dad1b8c394
commit
ffebfe120b
@@ -2600,9 +2600,9 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public Long setbit(String key, long offset, String value) {
|
||||
public boolean setbit(String key, long offset, boolean value) {
|
||||
client.setbit(key, offset, value);
|
||||
return client.getIntegerReply();
|
||||
return client.getIntegerReply() == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2612,8 +2612,8 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param offset
|
||||
* @return
|
||||
*/
|
||||
public Long getbit(String key, long offset) {
|
||||
public boolean getbit(String key, long offset) {
|
||||
client.getbit(key, offset);
|
||||
return client.getIntegerReply();
|
||||
return client.getIntegerReply() == 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user