public class RList extends RBase
redisTemplate| 构造器和说明 |
|---|
RList(org.springframework.data.redis.core.RedisTemplate<String,Object> redisTemplate)
构造器给父类注入RedisTemplate
|
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
getElementByIndex(String key,
long index,
Class<T> type)
根据索引获取List中的元素并转换为指定类型
|
Long |
leftPush(String key,
Object value)
左侧添加单个值
|
<V> Long |
leftPushAll(String key,
Collection<V> dataCollection)
左侧批量添加多个值(使用Collection参数方式)
|
<V> Long |
leftPushAll(String key,
List<V> dataList)
左侧批量添加多个值(使用List参数方式)
|
<T> T |
popLeft(String key,
Class<T> type)
从左侧弹出元素并转换为指定类型
|
<T> T |
popRight(String key,
Class<T> type)
从右侧弹出元素并转换为指定类型
|
<T> List<T> |
rangeAll(String key,
Class<T> type)
获取List中的所有数据,并将每个元素转换为指定类型
|
Long |
removeByValue(String key,
long count,
Object value)
根据值移除指定数量的匹配元素
|
Long |
rightPush(String key,
Object value)
右侧添加单个值
|
<V> Long |
rightPushAll(String key,
Collection<V> dataCollection)
右侧批量添加多个值(使用Collection参数方式)
|
<V> Long |
rightPushAll(String key,
List<V> dataList)
右侧批量添加多个值(使用List参数方式)
|
void |
set(String key,
long index,
Object value)
根据索引设置List中的值
|
Long |
size(String key)
获取List的长度
|
buildKeyByCustomSeparator, buildKeyByDefaultSeparator, convertValue, delete, deleteBatch, executeLuaScript, expire, expire, getExpire, hasKeypublic Long leftPush(String key, Object value)
key - 键value - 要添加的值public <V> Long leftPushAll(String key, List<V> dataList)
V - 值类型key - 键dataList - 要添加的值列表public <V> Long leftPushAll(String key, Collection<V> dataCollection)
V - 值类型key - 键dataCollection - 要添加的值集合public Long rightPush(String key, Object value)
key - 键value - 要添加的值public <V> Long rightPushAll(String key, List<V> dataList)
V - 值类型key - 键dataList - 要添加的值列表public <V> Long rightPushAll(String key, Collection<V> dataCollection)
V - 值类型key - 键dataCollection - 要添加的值集合public Long removeByValue(String key, long count, Object value)
key - 键count - 要移除的元素数量value - 要移除的值public <T> T popRight(String key, Class<T> type)
T - 泛型,表示期望的返回类型key - 键type - 期望的返回值类型public <T> T popLeft(String key, Class<T> type)
T - 泛型,表示期望的返回类型key - 键type - 期望的返回值类型public void set(String key, long index, Object value)
key - 键index - 索引位置,从0开始value - 设置的值public <T> List<T> rangeAll(String key, Class<T> type)
T - 要转换的值类型key - 键type - 要转换的值类型public <T> T getElementByIndex(String key, long index, Class<T> type)
T - 泛型,表示期望的返回类型key - 键index - 索引位置,从0开始type - 期望的返回值类型Copyright © 2025. All rights reserved.