public static Boolean stringToBoolean(String s) { return stringToBooleanConverter().convert(s); }
@Override public Boolean set(byte[] key, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().set(key, value), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().set(key, value), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(connection.getJedis().set(key, value)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Boolean setEx(byte[] key, long seconds, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); if (seconds > Integer.MAX_VALUE) { throw new IllegalArgumentException("Time must be less than Integer.MAX_VALUE for setEx in Jedis."); } try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().setex(key, (int) seconds, value), Converters.stringToBooleanConverter(), () -> false)); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().setex(key, (int) seconds, value), Converters.stringToBooleanConverter(), () -> false)); return null; } return Converters.stringToBoolean(connection.getJedis().setex(key, (int) seconds, value)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Boolean setEx(byte[] key, long seconds, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { if (isPipelined()) { pipeline(connection.newLettuceResult(getAsyncConnection().setex(key, seconds, value), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction(connection.newLettuceResult(getAsyncConnection().setex(key, seconds, value), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(getConnection().setex(key, seconds, value)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public Boolean pSetEx(byte[] key, long milliseconds, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { if (isPipelined()) { pipeline(connection.newLettuceResult(getAsyncConnection().psetex(key, milliseconds, value), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction(connection.newLettuceResult(getAsyncConnection().psetex(key, milliseconds, value), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(getConnection().psetex(key, milliseconds, value)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public Boolean set(byte[] key, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { if (isPipelined()) { pipeline( connection.newLettuceResult(getAsyncConnection().set(key, value), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction( connection.newLettuceResult(getAsyncConnection().set(key, value), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(getConnection().set(key, value)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public Boolean pSetEx(byte[] key, long milliseconds, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().psetex(key, milliseconds, value), Converters.stringToBooleanConverter(), () -> false)); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().psetex(key, milliseconds, value), Converters.stringToBooleanConverter(), () -> false)); return null; } return Converters.stringToBoolean(connection.getJedis().psetex(key, milliseconds, value)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Boolean set(byte[] key, byte[] value, Expiration expiration, SetOption option) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); Assert.notNull(expiration, "Expiration must not be null!"); Assert.notNull(option, "Option must not be null!"); try { if (isPipelined()) { pipeline(connection.newLettuceResult( getAsyncConnection().set(key, value, LettuceConverters.toSetArgs(expiration, option)), Converters.stringToBooleanConverter(), () -> false)); return null; } if (isQueueing()) { transaction(connection.newLettuceResult( getAsyncConnection().set(key, value, LettuceConverters.toSetArgs(expiration, option)), Converters.stringToBooleanConverter(), () -> false)); return null; } return Converters .stringToBoolean(getConnection().set(key, value, LettuceConverters.toSetArgs(expiration, option))); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public Boolean mSet(Map<byte[], byte[]> tuples) { Assert.notNull(tuples, "Tuples must not be null!"); try { if (isPipelined()) { pipeline(connection.newLettuceResult(getAsyncConnection().mset(tuples), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction( connection.newLettuceResult(getAsyncConnection().mset(tuples), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(getConnection().mset(tuples)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public Boolean mSet(Map<byte[], byte[]> tuples) { Assert.notNull(tuples, "Tuples must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().mset(JedisConverters.toByteArrays(tuples)), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction( connection.newJedisResult(connection.getRequiredTransaction().mset(JedisConverters.toByteArrays(tuples)), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(connection.getJedis().mset(JedisConverters.toByteArrays(tuples))); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
Converters.stringToBooleanConverter(), () -> false)); return null; Converters.stringToBooleanConverter(), () -> false)); return null; Converters.stringToBooleanConverter(), () -> false)); return null; Converters.stringToBooleanConverter(), () -> false)); return null;
public static Boolean stringToBoolean(String s) { return stringToBooleanConverter().convert(s); }
public static Boolean stringToBoolean(String s) { return stringToBooleanConverter().convert(s); }
@Override public Boolean set(byte[] key, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().set(key, value), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().set(key, value), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(connection.getJedis().set(key, value)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Boolean setEx(byte[] key, long seconds, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { if (isPipelined()) { pipeline(connection.newLettuceResult(getAsyncConnection().setex(key, seconds, value), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction(connection.newLettuceResult(getAsyncConnection().setex(key, seconds, value), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(getConnection().setex(key, seconds, value)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public Boolean set(byte[] key, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { if (isPipelined()) { pipeline( connection.newLettuceResult(getAsyncConnection().set(key, value), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction( connection.newLettuceResult(getAsyncConnection().set(key, value), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(getConnection().set(key, value)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public Boolean set(byte[] key, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { if (isPipelined()) { pipeline( connection.newLettuceResult(getAsyncConnection().set(key, value), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction( connection.newLettuceResult(getAsyncConnection().set(key, value), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(getConnection().set(key, value)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public Boolean mSet(Map<byte[], byte[]> tuples) { Assert.notNull(tuples, "Tuples must not be null!"); try { if (isPipelined()) { pipeline(connection.newLettuceResult(getAsyncConnection().mset(tuples), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction( connection.newLettuceResult(getAsyncConnection().mset(tuples), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(getConnection().mset(tuples)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public Boolean mSet(Map<byte[], byte[]> tuples) { Assert.notNull(tuples, "Tuples must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().mset(JedisConverters.toByteArrays(tuples)), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction( connection.newJedisResult(connection.getRequiredTransaction().mset(JedisConverters.toByteArrays(tuples)), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(connection.getJedis().mset(JedisConverters.toByteArrays(tuples))); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Boolean mSet(Map<byte[], byte[]> tuples) { Assert.notNull(tuples, "Tuples must not be null!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().mset(JedisConverters.toByteArrays(tuples)), Converters.stringToBooleanConverter())); return null; } if (isQueueing()) { transaction( connection.newJedisResult(connection.getRequiredTransaction().mset(JedisConverters.toByteArrays(tuples)), Converters.stringToBooleanConverter())); return null; } return Converters.stringToBoolean(connection.getJedis().mset(JedisConverters.toByteArrays(tuples))); } catch (Exception ex) { throw convertJedisAccessException(ex); } }