public class ListTypeHandler extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
String |
blpop(String key,
Long timeout,
TimeUnit unit)
从左弹出字符串
BLPOP key [key ...] timeout
|
<T> T |
blpopAsObj(String key,
Long timeout,
TimeUnit unit)
从左弹出对象
BLPOP key [key ...] timeout
|
String |
brpop(String key,
Long timeout,
TimeUnit unit)
从右弹出字符串
BRPOP key [key ...] timeout
|
<T> T |
brpopAsObj(String key,
Long timeout,
TimeUnit unit)
从右弹出对象
BRPOP key [key ...] timeout
|
List<String> |
getAll(String key)
获取所有字符串
LRANGE key start stop
|
List |
getAllAsObj(String key)
获取所有对象
LRANGE key start stop
|
static ListTypeHandler |
getInstance(org.springframework.data.redis.core.RedisTemplate redisTemplate,
org.springframework.data.redis.core.StringRedisTemplate stringRedisTemplate)
获取实例
|
org.springframework.data.redis.core.RedisTemplate |
getRedisTemplate()
获取spring redis模板
|
org.springframework.data.redis.core.StringRedisTemplate |
getStringRedisTemplate()
获取spring string redis模板
|
String |
lget(String key,
Long index)
从左获取字符串
LINDEX key index
|
<T> T |
lgetAsObj(String key,
Long index)
从左获取对象
LINDEX key index
|
String |
lpop(String key)
从左弹出字符串
LPOP key
|
String |
lpopAndlpush(String key,
String otherKey)
从左弹出字符串并从左插入到另一个列表
|
<T> T |
lpopAndlpushAsObj(String key,
String otherKey)
从左弹出对象并从左插入到另一个列表
|
String |
lpopAndrpush(String key,
String otherKey)
从左弹出字符串并从右插入到另一个列表
|
<T> T |
lpopAndrpushAsObj(String key,
String otherKey)
从左弹出对象并从右插入到另一个列表
|
<T> T |
lpopAsObj(String key)
从左弹出对象
LPOP key
|
Long |
lpush(String key,
String value)
从左插入字符串
LPUSH key value [value ...]
|
Long |
lpush(String key,
String pivot,
String value)
按照中心点从左插入字符串
LINSERT key BEFORE|AFTER pivot value
|
Long |
lpushAll(String key,
String... values)
从左插入多个字符串
LPUSH key value [value ...]
|
Long |
lpushAllAsObj(String key,
Object... values)
从左插入多个对象
LPUSH key value [value ...]
|
Long |
lpushAsObj(String key,
Object value)
从左插入对象
LPUSH key value [value ...]
|
Long |
lpushAsObj(String key,
Object pivot,
Object value)
按照中心点从左插入对象
LINSERT key BEFORE|AFTER pivot value
|
Long |
lpushIfPresent(String key,
String value)
从左插入字符串如果列表存在
LPUSHX key value
|
Long |
lpushIfPresentAsObj(String key,
Object value)
从左插入对象如果列表存在
LPUSHX key value
|
List<String> |
lrange(String key,
Long startIndex,
Long endIndex)
从左获取范围内的字符串
LRANGE key start stop
|
List |
lrangeAsObj(String key,
Long startIndex,
Long endIndex)
从左获取范围内的对象
LRANGE key start stop
|
Long |
lremove(String key,
Long count,
String value)
从左移除字符串
LREM key count value
|
Long |
lremoveAsObj(String key,
Long count,
Object value)
从左移除对象
LREM key count value
|
void |
lset(String key,
Long index,
String value)
从左修改指定索引的字符串
LSET key index value
|
void |
lsetAsObj(String key,
Long index,
Object value)
从左修改指定索引的对象
LSET key index value
|
List<String> |
lsubList(String key,
Long startIndex,
Long endIndex)
从左截取字符串(会修改redis中列表)
LTRIM key start stop
|
List |
lsubListAsObj(String key,
Long startIndex,
Long endIndex)
从左截取对象(会修改redis中列表)
LTRIM key start stop
|
String |
rget(String key,
Long index)
从右获取字符串
LINDEX key index
|
<T> T |
rgetAsObj(String key,
Long index)
从右获取对象
LINDEX key index
|
String |
rpop(String key)
从右弹出字符串
RPOP key
|
String |
rpopAndlpush(String key,
String otherKey)
从右弹出字符串并从左插入到另一个列表
RPOPLPUSH source destination
|
<T> T |
rpopAndlpushAsObj(String key,
String otherKey)
从右弹出对象并从左插入到另一个列表
RPOPLPUSH source destination
|
String |
rpopAndrpush(String key,
String otherKey)
从右弹出字符串并从右插入到另一个列表
|
<T> T |
rpopAndrpushAsObj(String key,
String otherKey)
从右弹出对象并从右插入到另一个列表
|
<T> T |
rpopAsObj(String key)
从右弹出对象
RPOP key
|
Long |
rpush(String key,
String value)
从右插入字符串
RPUSH key value [value ...]
|
Long |
rpush(String key,
String pivot,
String value)
从右插入字符串
LINSERT key BEFORE|AFTER pivot value
|
Long |
rpushAll(String key,
String... value)
从右插入字符串
RPUSH key value [value ...]
|
Long |
rpushAllAsObj(String key,
Object... value)
从右插入对象
RPUSH key value [value ...]
|
Long |
rpushAsObj(String key,
Object value)
从右插入对象
RPUSH key value [value ...]
|
Long |
rpushAsObj(String key,
Object pivot,
Object value)
从右插入对象
LINSERT key BEFORE|AFTER pivot value
|
Long |
rpushIfPresent(String key,
String value)
从右插入字符串如果列表存在
RPUSHX key value
|
Long |
rpushIfPresentAsObj(String key,
Object value)
从右插入对象如果列表存在
RPUSHX key value
|
List<String> |
rrange(String key,
Long startIndex,
Long endIndex)
从右获取范围内的字符串
LRANGE key start stop
|
List |
rrangeAsObj(String key,
Long startIndex,
Long endIndex)
从右获取范围内的对象
LRANGE key start stop
|
Long |
rremove(String key,
Long count,
String value)
从右移除字符串
LREM key count value
|
Long |
rremoveAsObj(String key,
Long count,
Object value)
从右移除对象
LREM key count value
|
void |
rset(String key,
Long index,
String value)
从右修改指定索引的字符串
LSET key index value
|
void |
rsetAsObj(String key,
Long index,
Object value)
从右修改指定索引的对象
LSET key index value
|
List<String> |
rsubList(String key,
Long startIndex,
Long endIndex)
从右截取字符串(会修改redis中列表)
LTRIM key start stop
|
List |
rsubListAsObj(String key,
Long startIndex,
Long endIndex)
从右截取对象(会修改redis中列表)
LTRIM key start stop
|
Long |
size(String key)
获取字符串列表数量
LLEN key
|
Long |
sizeAsObj(String key)
获取对象列表数量
LLEN key
|
public static ListTypeHandler getInstance(org.springframework.data.redis.core.RedisTemplate redisTemplate, org.springframework.data.redis.core.StringRedisTemplate stringRedisTemplate)
redisTemplate - 对象模板stringRedisTemplate - 字符串模板public Long sizeAsObj(String key)
LLEN key
key - 键public List getAllAsObj(String key)
LRANGE key start stop
key - 键public List<String> getAll(String key)
LRANGE key start stop
key - 键public List lrangeAsObj(String key, Long startIndex, Long endIndex)
LRANGE key start stop
key - 键startIndex - 起始索引endIndex - 结束索引public List<String> lrange(String key, Long startIndex, Long endIndex)
LRANGE key start stop
key - 键startIndex - 起始索引endIndex - 结束索引public List rrangeAsObj(String key, Long startIndex, Long endIndex)
LRANGE key start stop
key - 键startIndex - 起始索引endIndex - 结束索引public List<String> rrange(String key, Long startIndex, Long endIndex)
LRANGE key start stop
key - 键startIndex - 起始索引endIndex - 结束索引public Long lremoveAsObj(String key, Long count, Object value)
LREM key count value
key - 键count - 个数value - 对象public Long lremove(String key, Long count, String value)
LREM key count value
key - 键count - 个数value - 字符串public Long rremoveAsObj(String key, Long count, Object value)
LREM key count value
key - 键count - 个数value - 对象public Long rremove(String key, Long count, String value)
LREM key count value
key - 键count - 个数value - 字符串public List lsubListAsObj(String key, Long startIndex, Long endIndex)
LTRIM key start stop
key - 键startIndex - 起始索引endIndex - 结束索引public List<String> lsubList(String key, Long startIndex, Long endIndex)
LTRIM key start stop
key - 键startIndex - 起始索引endIndex - 结束索引public List rsubListAsObj(String key, Long startIndex, Long endIndex)
LTRIM key start stop
key - 键startIndex - 起始索引endIndex - 结束索引public List<String> rsubList(String key, Long startIndex, Long endIndex)
LTRIM key start stop
key - 键startIndex - 起始索引endIndex - 结束索引public void lsetAsObj(String key, Long index, Object value)
LSET key index value
key - 键index - 索引value - 对象public void lset(String key, Long index, String value)
LSET key index value
key - 键index - 索引value - 字符串public void rsetAsObj(String key, Long index, Object value)
LSET key index value
key - 键index - 索引value - 对象public void rset(String key, Long index, String value)
LSET key index value
key - 键index - 索引value - 字符串public <T> T lgetAsObj(String key, Long index)
LINDEX key index
T - 对象类型key - 键index - 索引public String lget(String key, Long index)
LINDEX key index
key - 键index - 索引public <T> T rgetAsObj(String key, Long index)
LINDEX key index
T - 对象类型key - 键index - 索引public String rget(String key, Long index)
LINDEX key index
key - 键index - 索引public Long lpushAsObj(String key, Object value)
LPUSH key value [value ...]
key - 键value - 对象public Long lpushAsObj(String key, Object pivot, Object value)
LINSERT key BEFORE|AFTER pivot value
key - 键pivot - 中心点对象value - 对象public Long lpush(String key, String value)
LPUSH key value [value ...]
key - 键value - 字符串public Long lpush(String key, String pivot, String value)
LINSERT key BEFORE|AFTER pivot value
key - 键pivot - 中心点字符串value - 字符串public Long lpushAllAsObj(String key, Object... values)
LPUSH key value [value ...]
key - 键values - 对象public Long lpushAll(String key, String... values)
LPUSH key value [value ...]
key - 键values - 字符串public Long lpushIfPresentAsObj(String key, Object value)
LPUSHX key value
key - 键value - 对象public Long lpushIfPresent(String key, String value)
LPUSHX key value
key - 键value - 字符串public <T> T lpopAsObj(String key)
LPOP key
T - 对象类型key - 键public <T> T blpopAsObj(String key, Long timeout, TimeUnit unit)
BLPOP key [key ...] timeout
T - 对象类型key - 键timeout - 超时时间unit - 单位public String blpop(String key, Long timeout, TimeUnit unit)
BLPOP key [key ...] timeout
key - 键timeout - 超时时间unit - 单位public Long rpushAsObj(String key, Object value)
RPUSH key value [value ...]
key - 键value - 对象public Long rpush(String key, String value)
RPUSH key value [value ...]
key - 键value - 字符串public Long rpushAsObj(String key, Object pivot, Object value)
LINSERT key BEFORE|AFTER pivot value
key - 键pivot - 中心点对象value - 对象public Long rpush(String key, String pivot, String value)
LINSERT key BEFORE|AFTER pivot value
key - 键pivot - 中心点字符串value - 字符串public Long rpushIfPresentAsObj(String key, Object value)
RPUSHX key value
key - 键value - 对象public Long rpushIfPresent(String key, String value)
RPUSHX key value
key - 键value - 字符串public Long rpushAllAsObj(String key, Object... value)
RPUSH key value [value ...]
key - 键value - 对象public Long rpushAll(String key, String... value)
RPUSH key value [value ...]
key - 键value - 字符串public <T> T rpopAsObj(String key)
RPOP key
T - 对象类型key - 键public <T> T brpopAsObj(String key, Long timeout, TimeUnit unit)
BRPOP key [key ...] timeout
T - 对象类型key - 键timeout - 超时时间unit - 单位public String brpop(String key, Long timeout, TimeUnit unit)
BRPOP key [key ...] timeout
key - 键timeout - 超时时间unit - 单位public <T> T lpopAndlpushAsObj(String key, String otherKey)
T - 对象类型key - 键otherKey - 键public String lpopAndlpush(String key, String otherKey)
key - 键otherKey - 键public <T> T rpopAndlpushAsObj(String key, String otherKey)
RPOPLPUSH source destination
T - 对象类型key - 键otherKey - 键public String rpopAndlpush(String key, String otherKey)
RPOPLPUSH source destination
key - 键otherKey - 键public <T> T rpopAndrpushAsObj(String key, String otherKey)
T - 对象类型key - 键otherKey - 键public String rpopAndrpush(String key, String otherKey)
key - 键otherKey - 键public <T> T lpopAndrpushAsObj(String key, String otherKey)
T - 对象类型key - 键otherKey - 键public String lpopAndrpush(String key, String otherKey)
key - 键otherKey - 键public org.springframework.data.redis.core.RedisTemplate getRedisTemplate()
public org.springframework.data.redis.core.StringRedisTemplate getStringRedisTemplate()
Copyright © 2019. All rights reserved.