public class RedisListProvider<T> extends Object implements IListCache<T>
| 构造器和说明 |
|---|
RedisListProvider(org.springframework.data.redis.core.RedisTemplate template) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear(String key)
清空列表
|
T |
get(String key,
long index)
获取指定索引位置的值
|
void |
leftPush(String key,
Collection<T> values)
进栈
|
void |
leftPush(String key,
T value)
进栈
|
void |
pop(String key)
出栈
|
void |
push(String key,
Collection<T> values)
入队列
|
void |
push(String key,
T value)
入队列
|
List<T> |
range(String key,
long start,
long end)
获取范围值
|
void |
remove(String key,
long count,
T value)
删除列表中值为 value 的元素,总共删除 count 次
|
void |
remove(String key,
T value)
删除列表中值为 value 的所有元素
|
void |
rightPop(String key)
出队列
|
void |
set(String key,
long index,
T value)
设置列表中指定下标的值
|
Long |
size(String key)
返回列表的长度
|
void |
trim(String key,
long start,
long end)
截取列表,保留 [start, end] 之间的值
|
public RedisListProvider(org.springframework.data.redis.core.RedisTemplate template)
public T get(String key, long index)
IListCacheget 在接口中 IListCache<T>key - 键index - 下标public List<T> range(String key, long start, long end)
IListCacherange 在接口中 IListCache<T>key - 键start - 开始位置end - 结束位置public void leftPush(String key, T value)
IListCacheleftPush 在接口中 IListCache<T>key - 键value - 值public void leftPush(String key, Collection<T> values)
IListCacheleftPush 在接口中 IListCache<T>key - 键values - 集合值public void push(String key, T value)
IListCachepush 在接口中 IListCache<T>key - 键value - 值public void push(String key, Collection<T> values)
IListCachepush 在接口中 IListCache<T>key - 键values - 集合值public void pop(String key)
IListCachepop 在接口中 IListCache<T>key - 键public void rightPop(String key)
IListCacherightPop 在接口中 IListCache<T>key - 键public void set(String key, long index, T value)
IListCacheset 在接口中 IListCache<T>key - 键index - 下标value - 值public void remove(String key, T value)
IListCacheremove 在接口中 IListCache<T>key - 键value - 值public void remove(String key, long count, T value)
IListCacheremove 在接口中 IListCache<T>key - 键count - 数量value - 值public void trim(String key, long start, long end)
IListCachetrim 在接口中 IListCache<T>key - 键start - 开始位置end - 结束位置public Long size(String key)
IListCachesize 在接口中 IListCache<T>key - 键public void clear(String key)
IListCacheclear 在接口中 IListCache<T>Copyright © 2021. All rights reserved.