public interface ListOperations<K,V>
| Modifier and Type | Interface and Description |
|---|---|
static class |
ListOperations.MoveFrom<K>
Value object representing the
where from part for the LMOVE command. |
static class |
ListOperations.MoveTo<K>
Value object representing the
where to from part for the LMOVE command. |
| Modifier and Type | Method and Description |
|---|---|
RedisOperations<K,V> |
getOperations() |
V |
index(K key,
long index)
Get element at
index form list at key. |
Long |
indexOf(K key,
V value)
Returns the index of the first occurrence of the specified value in the list at at
key. |
Long |
lastIndexOf(K key,
V value)
Returns the index of the last occurrence of the specified value in the list at at
key. |
V |
leftPop(K key)
Removes and returns first element in list stored at
key. |
default V |
leftPop(K key,
Duration timeout)
Removes and returns first element from lists stored at
key . |
List<V> |
leftPop(K key,
long count)
Removes and returns first elements in list stored at
key. |
V |
leftPop(K key,
long timeout,
TimeUnit unit)
Removes and returns first element from lists stored at
key . |
Long |
leftPush(K key,
V value)
Prepend
value to key. |
Long |
leftPush(K key,
V pivot,
V value)
Insert
value to key before pivot. |
Long |
leftPushAll(K key,
Collection<V> values)
Prepend
values to key. |
Long |
leftPushAll(K key,
V... values)
Prepend
values to key. |
Long |
leftPushIfPresent(K key,
V value)
Prepend
values to key only if the list exists. |
V |
move(K sourceKey,
RedisListCommands.Direction from,
K destinationKey,
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. |
default V |
move(K sourceKey,
RedisListCommands.Direction from,
K destinationKey,
RedisListCommands.Direction to,
Duration 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. |
V |
move(K sourceKey,
RedisListCommands.Direction from,
K destinationKey,
RedisListCommands.Direction to,
long timeout,
TimeUnit unit)
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. |
default V |
move(ListOperations.MoveFrom<K> from,
ListOperations.MoveTo<K> 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. |
default V |
move(ListOperations.MoveFrom<K> from,
ListOperations.MoveTo<K> to,
Duration 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<V> |
range(K key,
long start,
long end)
Get elements between
begin and end from list at key. |
Long |
remove(K key,
long count,
Object value)
Removes the first
count occurrences of value from the list stored at key. |
V |
rightPop(K key)
Removes and returns last element in list stored at
key. |
default V |
rightPop(K key,
Duration timeout)
Removes and returns last element from lists stored at
key. |
List<V> |
rightPop(K key,
long count)
Removes and returns last elements in list stored at
key. |
V |
rightPop(K key,
long timeout,
TimeUnit unit)
Removes and returns last element from lists stored at
key. |
V |
rightPopAndLeftPush(K sourceKey,
K destinationKey)
Remove the last element from list at
sourceKey, append it to destinationKey and return its value. |
default V |
rightPopAndLeftPush(K sourceKey,
K destinationKey,
Duration timeout)
Remove the last element from list at
srcKey, append it to dstKey and return its value. |
V |
rightPopAndLeftPush(K sourceKey,
K destinationKey,
long timeout,
TimeUnit unit)
Remove the last element from list at
srcKey, append it to dstKey and return its value. |
Long |
rightPush(K key,
V value)
Append
value to key. |
Long |
rightPush(K key,
V pivot,
V value)
Insert
value to key after pivot. |
Long |
rightPushAll(K key,
Collection<V> values)
Append
values to key. |
Long |
rightPushAll(K key,
V... values)
Append
values to key. |
Long |
rightPushIfPresent(K key,
V value)
Append
values to key only if the list exists. |
void |
set(K key,
long index,
V value)
Set the
value list element at index. |
Long |
size(K key)
Get the size of list stored at
key. |
void |
trim(K key,
long start,
long end)
Trim list at
key to elements between start and end. |
@Nullable List<V> range(K key, long start, long end)
begin and end from list at key.key - must not be null.start - end - void trim(K key, long start, long end)
key to elements between start and end.key - must not be null.start - end - @Nullable Long size(K key)
key.key - must not be null.@Nullable Long leftPush(K key, V value)
value to key.key - must not be null.value - @Nullable Long leftPushAll(K key, V... values)
values to key.key - must not be null.values - @Nullable Long leftPushAll(K key, Collection<V> values)
values to key.key - must not be null.values - must not be null.@Nullable Long leftPushIfPresent(K key, V value)
values to key only if the list exists.key - must not be null.value - @Nullable Long leftPush(K key, V pivot, V value)
value to key before pivot.key - must not be null.pivot - must not be null.value - @Nullable Long rightPush(K key, V value)
value to key.key - must not be null.value - @Nullable Long rightPushAll(K key, V... values)
values to key.key - must not be null.values - @Nullable Long rightPushAll(K key, Collection<V> values)
values to key.key - must not be null.values - @Nullable Long rightPushIfPresent(K key, V value)
values to key only if the list exists.key - must not be null.value - @Nullable Long rightPush(K key, V pivot, V value)
value to key after pivot.key - must not be null.pivot - must not be null.value - @Nullable default V move(ListOperations.MoveFrom<K> from, ListOperations.MoveTo<K> 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.from - must not be null.to - must not be null.@Nullable V move(K sourceKey, RedisListCommands.Direction from, K destinationKey, 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.from - must not be null.destinationKey - must not be null.to - must not be null.@Nullable default V move(ListOperations.MoveFrom<K> from, ListOperations.MoveTo<K> to, Duration 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.
from - must not be null.to - must not be null.timeout - must not be null or negative.@Nullable default V move(K sourceKey, RedisListCommands.Direction from, K destinationKey, RedisListCommands.Direction to, Duration 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.from - must not be null.destinationKey - must not be null.to - must not be null.timeout - must not be null or negative.@Nullable V move(K sourceKey, RedisListCommands.Direction from, K destinationKey, RedisListCommands.Direction to, long timeout, TimeUnit unit)
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.from - must not be null.destinationKey - must not be null.to - must not be null.timeout - unit - void set(K key, long index, V value)
value list element at index.key - must not be null.index - value - @Nullable Long remove(K key, long count, Object value)
count occurrences of value from the list stored at key.key - must not be null.count - value - @Nullable V index(K key, long index)
index form list at key.key - must not be null.index - Long indexOf(K key, V value)
key. key - must not be null.value - must not be null.Long lastIndexOf(K key, V value)
key. key - must not be null.value - must not be null.@Nullable V leftPop(K key)
key.key - must not be null.@Nullable List<V> leftPop(K key, long count)
key.key - must not be null.count - @Nullable V leftPop(K key, long timeout, TimeUnit unit)
key . timeout reached.key - must not be null.timeout - unit - must not be null.@Nullable default V leftPop(K key, Duration timeout)
key . timeout reached.key - must not be null.timeout - must not be null.IllegalArgumentException - if the timeout is null or negative.@Nullable V rightPop(K key)
key.key - must not be null.@Nullable List<V> rightPop(K key, long count)
key.key - must not be null.count - @Nullable V rightPop(K key, long timeout, TimeUnit unit)
key. timeout reached.key - must not be null.timeout - unit - must not be null.@Nullable default V rightPop(K key, Duration timeout)
key. timeout reached.key - must not be null.timeout - must not be null.@Nullable V rightPopAndLeftPush(K sourceKey, K destinationKey)
sourceKey, append it to destinationKey and return its value.sourceKey - must not be null.destinationKey - must not be null.@Nullable V rightPopAndLeftPush(K sourceKey, K destinationKey, long timeout, TimeUnit unit)
srcKey, append it to dstKey and return its value.timeout reached.sourceKey - must not be null.destinationKey - must not be null.timeout - unit - must not be null.@Nullable default V rightPopAndLeftPush(K sourceKey, K destinationKey, Duration timeout)
srcKey, append it to dstKey and return its value.timeout reached.sourceKey - must not be null.destinationKey - must not be null.timeout - must not be null.IllegalArgumentException - if the timeout is null or negative.RedisOperations<K,V> getOperations()
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.