@Override public Long lRem(byte[] key, long count, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { return connection.getCluster().lrem(key, count, value); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
/** * 根据参数 count 的值,移除列表中与参数 value 相等的元素。 * 默认count = 1 * 从表头开始向表尾搜索,移除与 value 相等的元素,数量为 count 。 * @param key * @param value * @return */ public Long popValueFromList(String key, String value) { return jedisCluster.lrem(key, 1, value); }
/** * count > 0 : 从表头开始向表尾搜索,移除与 value 相等的元素,数量为 count * count < 0 : 从表尾开始向表头搜索,移除与 value 相等的元素,数量为 count 的绝对值 * count = 0 : 移除表中所有与 value 相等的值 * @param key * @param count * @param value * @return 被移除元素的数量 */ public long lrem(String key,long count,String value){ return jedisCluster.lrem(key, count, value); } /**
@Override public Long lrem(byte[] bytes, long l, byte[] bytes1) { return cluster.lrem(bytes, l, bytes1); }
public Long lrem(String key, long count, String value) { return jedisCluster.lrem(key, count, value); }
public Long lrem(byte[] key, long count, byte[] value) { return jedisCluster.lrem(key, count, value); }
@Override public Long lRem(byte[] key, long count, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { return connection.getCluster().lrem(key, count, value); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Long lRem(byte[] key, long count, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(value, "Value must not be null!"); try { return connection.getCluster().lrem(key, count, value); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
/** * 根据参数 count 的值,移除列表中与参数 value 相等的元素。 * count 的值可以是以下几种: * count 大于 0 : 从表头开始向表尾搜索,移除与 value 相等的元素,数量为 count 。 * count 小于 0 : 从表尾开始向表头搜索,移除与 value 相等的元素,数量为 count 的绝对值。 * count 等于 0 : 移除表中所有与 value 相等的值。 */ public Long lrem(Object key, long count, Object value) { return jedisCluster.lrem(keyToBytes(key), count, valueToBytes(value)); }
@Override public <T> Long lrem(Class<T> clazz, String key, T value) { try { byte[] bytes = getRedisBuffer().write(value); return jedisCluster.lrem(SafeEncoder.encode(key), 0, bytes); } catch (IOException e) { logger.error(e.getMessage(), e); return null; } }
@Override public Long lrem(String key, String value) { return jedisCluster.lrem(SafeEncoder.encode(key), 0, SafeEncoder.encode(value)); }
@Override public long lrem(final String key, final int count, final String value) { Assert.hasText(key); Assert.hasText(value); try { return cluster.lrem(key, count, value); } catch (final Throwable e) { throw new RedisClientException(e.getMessage(), e); } }
public Long lrem(Object key, Object obj) { if (null == key || null == obj) { return null; } if (cluster) { return jedisCluster.lrem(serializeKey(key), 0, serializeVal(obj)); } else { return jedisOperator.lrem(serializeKey(key), 0, serializeVal(obj)); } }
/** * 根据参数 count 的值,移除列表中与参数 value 相等的元素。 * count 的值可以是以下几种: * count > 0 : 从表头开始向表尾搜索,移除与 value 相等的元素,数量为 count 。 * count < 0 : 从表尾开始向表头搜索,移除与 value 相等的元素,数量为 count 的绝对值。 * count = 0 : 移除表中所有与 value 相等的值。 */ public Long lrem(Object key, int count, Object obj) { if (null == key || null == obj) { return null; } if (cluster) { return jedisCluster.lrem(serializeKey(key), count, serializeVal(obj)); } else { return jedisOperator.lrem(serializeKey(key), count, serializeVal(obj)); } }