diff --git a/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java b/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java index 1f6c1e7e6..a7a5386bb 100644 --- a/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java @@ -447,7 +447,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.exists(key)); return null; } - return client.exists(key).data() == 1; + return SrpUtils.asBoolean(client.exists(key)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -460,7 +460,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.expire(key, seconds)); return null; } - return client.expire(key, seconds).data() == 1; + return SrpUtils.asBoolean(client.expire(key, seconds)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -473,7 +473,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.expireat(key, unixTime)); return null; } - return client.expireat(key, unixTime).data() == 1; + return SrpUtils.asBoolean(client.expireat(key, unixTime)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -536,7 +536,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.persist(key)); return null; } - return client.persist(key).data() == 1; + return SrpUtils.asBoolean(client.persist(key)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -549,7 +549,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.move(key, dbIndex)); return null; } - return client.move(key, dbIndex).data() == 1; + return SrpUtils.asBoolean(client.move(key, dbIndex)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -588,7 +588,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.renamenx(oldName, newName)); return null; } - return (client.renamenx(oldName, newName).data() == 1); + return SrpUtils.asBoolean(client.renamenx(oldName, newName)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -791,7 +791,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.setnx(key, value)); return null; } - return client.setnx(key, value).data() == 1; + return SrpUtils.asBoolean(client.setnx(key, value)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -869,7 +869,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.getbit(key, offset)); return null; } - return (client.getbit(key, offset).data() == 1); + return SrpUtils.asBoolean(client.getbit(key, offset)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1154,7 +1154,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.sadd(key, new Object[] { value })); return null; } - return (client.sadd(key, new Object[] { value }).data() == 1); + return SrpUtils.asBoolean(client.sadd(key, new Object[] { value })); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1232,7 +1232,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.sismember(key, value)); return null; } - return client.sismember(key, value).data() == 1; + return SrpUtils.asBoolean(client.sismember(key, value)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1258,7 +1258,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.smove(srcKey, destKey, value)); return null; } - return client.smove(srcKey, destKey, value).data() == 1; + return SrpUtils.asBoolean(client.smove(srcKey, destKey, value)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1297,7 +1297,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.srem(key, new Object[] { value })); return null; } - return client.srem(key, new Object[] { value }).data() == 1; + return SrpUtils.asBoolean(client.srem(key, new Object[] { value })); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1340,7 +1340,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.zadd(new Object[] { key, score, value })); return null; } - return client.zadd(new Object[] { key, score, value }).data() == 1; + return SrpUtils.asBoolean(client.zadd(new Object[] { key, score, value })); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1569,7 +1569,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.zrem(key, new Object[] { value })); return null; } - return client.zrem(key, new Object[] { value }).data() == 1; + return SrpUtils.asBoolean(client.zrem(key, new Object[] { value })); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1669,7 +1669,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.hset(key, field, value)); return null; } - return client.hset(key, field, value).data() == 1; + return SrpUtils.asBoolean(client.hset(key, field, value)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1682,7 +1682,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.hsetnx(key, field, value)); return null; } - return client.hsetnx(key, field, value).data() == 1; + return SrpUtils.asBoolean(client.hsetnx(key, field, value)); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1695,7 +1695,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.hdel(key, new Object[] { field })); return null; } - return client.hdel(key, new Object[] { field }).data() == 1; + return SrpUtils.asBoolean(client.hdel(key, new Object[] { field })); } catch (Exception ex) { throw convertSrpAccessException(ex); } @@ -1708,7 +1708,7 @@ public class SrpConnection implements RedisConnection { pipeline(pipeline.hexists(key, field)); return null; } - return client.hexists(key, field).data() == 1; + return SrpUtils.asBoolean(client.hexists(key, field)); } catch (Exception ex) { throw convertSrpAccessException(ex); }