public interface RedisListCommands
Modifier and Type | Interface and Description |
---|---|
static class |
RedisListCommands.Direction
List move direction.
|
static class |
RedisListCommands.Position
List insertion position.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
bLMove(byte[] sourceKey,
byte[] destinationKey,
RedisListCommands.Direction from,
RedisListCommands.Direction to,
double timeout)
Atomically returns and removes the first/last element (head/tail depending on the
from argument) of the
list stored at sourceKey , and pushes the element at the first/last element (head/tail depending on the
to argument) of the list stored at destinationKey . |
List<byte[]> |
bLPop(int timeout,
byte[]... keys)
Removes and returns first element from lists stored at
keys . |
List<byte[]> |
bRPop(int timeout,
byte[]... keys)
Removes and returns last element from lists stored at
keys . |
byte[] |
bRPopLPush(int timeout,
byte[] srcKey,
byte[] dstKey)
Remove the last element from list at
srcKey , append it to dstKey and return its value. |
byte[] |
lIndex(byte[] key,
long index)
Get element at
index form list at key . |
Long |
lInsert(byte[] key,
RedisListCommands.Position where,
byte[] pivot,
byte[] value)
Insert
value RedisListCommands.Position.BEFORE or RedisListCommands.Position.AFTER existing pivot for key . |
Long |
lLen(byte[] key)
Get the size of list stored at
key . |
byte[] |
lMove(byte[] sourceKey,
byte[] destinationKey,
RedisListCommands.Direction from,
RedisListCommands.Direction to)
Atomically returns and removes the first/last element (head/tail depending on the
from argument) of the
list stored at sourceKey , and pushes the element at the first/last element (head/tail depending on the
to argument) of the list stored at destinationKey . |
byte[] |
lPop(byte[] key)
Removes and returns first element in list stored at
key . |
List<byte[]> |
lPop(byte[] key,
long count)
Removes and returns first elements in list stored at
key . |
default Long |
lPos(byte[] key,
byte[] element)
Returns the index of matching elements inside the list stored at given key.
|
List<Long> |
lPos(byte[] key,
byte[] element,
Integer rank,
Integer count)
Returns the index of matching elements inside the list stored at given key.
|
Long |
lPush(byte[] key,
byte[]... values)
Prepend
values to key . |
Long |
lPushX(byte[] key,
byte[] value)
Prepend
values to key only if the list exists. |
List<byte[]> |
lRange(byte[] key,
long start,
long end)
Get elements between
start and end from list at key . |
Long |
lRem(byte[] key,
long count,
byte[] value)
Removes the first
count occurrences of value from the list stored at key . |
void |
lSet(byte[] key,
long index,
byte[] value)
Set the
value list element at index . |
void |
lTrim(byte[] key,
long start,
long end)
Trim list at
key to elements between start and end . |
byte[] |
rPop(byte[] key)
Removes and returns last element in list stored at
key . |
List<byte[]> |
rPop(byte[] key,
long count)
Removes and returns last elements in list stored at
key . |
byte[] |
rPopLPush(byte[] srcKey,
byte[] dstKey)
Remove the last element from list at
srcKey , append it to dstKey and return its value. |
Long |
rPush(byte[] key,
byte[]... values)
Append
values to key . |
Long |
rPushX(byte[] key,
byte[] value)
Append
values to key only if the list exists. |
@Nullable Long rPush(byte[] key, byte[]... values)
values
to key
.key
- must not be null.values
- must not be empty.@Nullable default Long lPos(byte[] key, byte[] element)
key
- must not be null.element
- must not be null.@Nullable List<Long> lPos(byte[] key, byte[] element, @Nullable Integer rank, @Nullable Integer count)
key
- must not be null.element
- must not be null.rank
- specifies the "rank" of the first element to return, in case there are multiple matches. A rank of 1
means to return the first match, 2 to return the second match, and so forth.count
- number of matches to return.@Nullable Long lPush(byte[] key, byte[]... values)
values
to key
.key
- must not be null.values
- must not be empty.@Nullable Long rPushX(byte[] key, byte[] value)
values
to key
only if the list exists.key
- must not be null.value
- must not be null.@Nullable Long lPushX(byte[] key, byte[] value)
values
to key
only if the list exists.key
- must not be null.value
- must not be null.@Nullable Long lLen(byte[] key)
key
.key
- must not be null.@Nullable List<byte[]> lRange(byte[] key, long start, long end)
start
and end
from list at key
.key
- must not be null.start
- end
- List
if key does not exists or range does not contain values. null when used in
pipeline / transaction.void lTrim(byte[] key, long start, long end)
key
to elements between start
and end
.key
- must not be null.start
- end
- @Nullable byte[] lIndex(byte[] key, long index)
index
form list at key
.key
- must not be null.index
- zero based index value. Use negative number to designate elements starting at the tail.@Nullable Long lInsert(byte[] key, RedisListCommands.Position where, byte[] pivot, byte[] value)
value
RedisListCommands.Position.BEFORE
or RedisListCommands.Position.AFTER
existing pivot
for key
.key
- must not be null.where
- must not be null.pivot
- must not be null.value
- must not be null.@Nullable byte[] lMove(byte[] sourceKey, byte[] destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to)
from
argument) of the
list stored at sourceKey
, and pushes the element at the first/last element (head/tail depending on the
to
argument) of the list stored at destinationKey
.sourceKey
- must not be null.destinationKey
- must not be null.from
- must not be null.to
- must not be null.bLMove(byte[], byte[], Direction, Direction, double)
@Nullable byte[] bLMove(byte[] sourceKey, byte[] destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to, double timeout)
from
argument) of the
list stored at sourceKey
, and pushes the element at the first/last element (head/tail depending on the
to
argument) of the list stored at destinationKey
.
Blocks connection until element available or timeout
reached.
sourceKey
- must not be null.destinationKey
- must not be null.from
- must not be null.to
- must not be null.timeout
- lMove(byte[], byte[], Direction, Direction)
void lSet(byte[] key, long index, byte[] value)
value
list element at index
.key
- must not be null.index
- value
- @Nullable Long lRem(byte[] key, long count, byte[] value)
count
occurrences of value
from the list stored at key
.key
- must not be null.count
- value
- @Nullable byte[] lPop(byte[] key)
key
.key
- must not be null.@Nullable List<byte[]> lPop(byte[] key, long count)
key
.key
- must not be null.count
- @Nullable byte[] rPop(byte[] key)
key
.key
- must not be null.@Nullable List<byte[]> rPop(byte[] key, long count)
key
.key
- must not be null.count
- @Nullable List<byte[]> bLPop(int timeout, byte[]... keys)
keys
. timeout
reached.timeout
- seconds to block.keys
- must not be null.List
when no element could be popped and the timeout was reached. null when used
in pipeline / transaction.lPop(byte[])
@Nullable List<byte[]> bRPop(int timeout, byte[]... keys)
keys
. timeout
reached.timeout
- seconds to block.keys
- must not be null.List
when no element could be popped and the timeout was reached. null when used
in pipeline / transaction.rPop(byte[])
@Nullable byte[] rPopLPush(byte[] srcKey, byte[] dstKey)
srcKey
, append it to dstKey
and return its value.srcKey
- must not be null.dstKey
- must not be null.@Nullable byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey)
srcKey
, append it to dstKey
and return its value. timeout
reached.timeout
- seconds to block.srcKey
- must not be null.dstKey
- must not be null.rPopLPush(byte[], byte[])
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.