public Long leftPushIfPresent(V value) { return ops.leftPushIfPresent(getKey(), value); }
public Long leftPush(V pivot, V value) { return ops.leftPush(getKey(), pivot, value); }
/** * List数据类型 读取某索引范围内key对应的list * * @param key * @param beginIndex 开始位置 * @param endIndex 结束位置 * @return 数据集合 */ public List getList(String key, long beginIndex, long endIndex) { listOps = redisTemplate.opsForList(); return (List) listOps.range(key, beginIndex, endIndex); }
public Long leftPush(V value) { return ops.leftPush(getKey(), value); }
public V rightPop(long timeout, TimeUnit unit) { return ops.rightPop(getKey(), timeout, unit); }
public Long rightPush(V value) { return ops.rightPush(getKey(), value); }
public void set(long index, V value) { ops.set(getKey(), index, value); }
public Long remove(long i, Object value) { return ops.remove(getKey(), i, value); }
/** * List数据类型 读取key绑定的list集合大小 * * @param key * @return 集合大小 */ public long getListCount(String key) { listOps = redisTemplate.opsForList(); return listOps.size(key); }
public void trim(long start, long end) { ops.trim(getKey(), start, end); }
/** * List数据类型 移出List下标从startIndex到endIndexr之外的值 * * @param key * @return null */ public void removeListForIndex(String key, Long startIndex, Long endIndex) { listOps = redisTemplate.opsForList(); listOps.trim(key, startIndex, endIndex); }
/** * List数据类型 移出List中的value元素 * * @param key * @param value * @return null */ public void removeListForValue(String key, String value) { listOps = redisTemplate.opsForList(); listOps.remove(key, 1l, value); }
/** * List数据类型 移出List头部第一个元素 * * @param key * @return 元素 */ public Serializable popList(String key) { listOps = redisTemplate.opsForList(); return listOps.leftPop(key); }
public Long size() { return ops.size(getKey()); }
public RedisOperations<K, V> getOperations() { return ops.getOperations(); }
public List<V> range(long start, long end) { return ops.range(getKey(), start, end); }
public V index(long index) { return ops.index(getKey(), index); }
public V rightPop() { return ops.rightPop(getKey()); }
public V leftPop() { return ops.leftPop(getKey()); }
public Long rightPushIfPresent(V value) { return ops.rightPushIfPresent(getKey(), value); }
public V leftPop(long timeout, TimeUnit unit) { return ops.leftPop(getKey(), timeout, unit); }
public Long rightPush(V pivot, V value) { return ops.rightPush(getKey(), pivot, value); }
/** * List数据类型 新增Key对应的list头部新增元素 * * @param key * @param objValue 可序列话的对象 * @return 插入后List中元素的数量 */ public long setList(String key, String objValue) { listOps = redisTemplate.opsForList(); return listOps.leftPush(key, objValue); }