public interface RedisList<E> extends RedisCollection<E>, List<E>, BlockingDeque<E>
List
contract. Supports List
, Queue
and Deque
contracts as
well as their equivalent blocking siblings BlockingDeque
and BlockingDeque
.Modifier and Type | Method and Description |
---|---|
static <E> RedisList<E> |
create(BoundListOperations<String,E> boundOps)
Constructs a new, uncapped
DefaultRedisList instance. |
static <E> RedisList<E> |
create(BoundListOperations<String,E> boundOps,
int maxSize)
Constructs a new
DefaultRedisList instance. |
static <E> RedisList<E> |
create(String key,
RedisOperations<String,E> operations)
Constructs a new, uncapped
RedisList instance. |
static <E> RedisList<E> |
create(String key,
RedisOperations<String,E> operations,
int maxSize)
Constructs a new
RedisList instance. |
E |
moveFirstTo(RedisList<E> destination,
RedisListCommands.Direction destinationPosition)
Atomically returns and removes the first element of the list stored at the bound key, and pushes the element at the
first/last element (head/tail depending on the
destinationPosition argument) of the list stored
at destination . |
default E |
moveFirstTo(RedisList<E> destination,
RedisListCommands.Direction destinationPosition,
Duration timeout)
Atomically returns and removes the first element of the list stored at the bound key, and pushes the element at the
first/last element (head/tail depending on the
destinationPosition argument) of the list stored
at destination . |
E |
moveFirstTo(RedisList<E> destination,
RedisListCommands.Direction destinationPosition,
long timeout,
TimeUnit unit)
Atomically returns and removes the first element of the list stored at the bound key, and pushes the element at the
first/last element (head/tail depending on the
destinationPosition argument) of the list stored
at destination . |
E |
moveLastTo(RedisList<E> destination,
RedisListCommands.Direction destinationPosition)
Atomically returns and removes the last element of the list stored at the bound key, and pushes the element at the
first/last element (head/tail depending on the
destinationPosition argument) of the list stored
at destination . |
default E |
moveLastTo(RedisList<E> destination,
RedisListCommands.Direction destinationPosition,
Duration timeout)
Atomically returns and removes the last element of the list stored at the bound key, and pushes the element at the
first/last element (head/tail depending on the
destinationPosition argument) of the list stored
at destination . |
E |
moveLastTo(RedisList<E> destination,
RedisListCommands.Direction destinationPosition,
long timeout,
TimeUnit unit)
Atomically returns and removes the last element of the list stored at the bound key, and pushes the element at the
first/last element (head/tail depending on the
destinationPosition argument) of the list stored
at destination . |
List<E> |
range(long start,
long end)
Get elements between
start and end from list at the bound key. |
RedisList<E> |
trim(int start,
int end)
Trim list at the bound key to elements between
start and end . |
RedisList<E> |
trim(long start,
long end)
Trim list at the bound key to elements between
start and end . |
getOperations
expire, expire, expireAt, expireAt, getExpire, getKey, getType, persist, rename
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
add, addFirst, addLast, contains, element, iterator, offer, offer, offerFirst, offerFirst, offerLast, offerLast, peek, poll, poll, pollFirst, pollLast, push, put, putFirst, putLast, remove, remove, removeFirstOccurrence, removeLastOccurrence, size, take, takeFirst, takeLast
drainTo, drainTo, remainingCapacity
descendingIterator, getFirst, getLast, peekFirst, peekLast, pollFirst, pollLast, pop, removeFirst, removeLast
parallelStream, removeIf, stream
static <E> RedisList<E> create(String key, RedisOperations<String,E> operations)
RedisList
instance.key
- Redis key of this list.operations
- RedisOperations
for the value type of this list.static <E> RedisList<E> create(String key, RedisOperations<String,E> operations, int maxSize)
RedisList
instance.key
- Redis key of this list.operations
- RedisOperations
for the value type of this list.maxSize
- static <E> RedisList<E> create(BoundListOperations<String,E> boundOps)
DefaultRedisList
instance.boundOps
- BoundListOperations
for the value type of this list.static <E> RedisList<E> create(BoundListOperations<String,E> boundOps, int maxSize)
DefaultRedisList
instance.boundOps
- BoundListOperations
for the value type of this list.maxSize
- @Nullable E moveFirstTo(RedisList<E> destination, RedisListCommands.Direction destinationPosition)
destinationPosition
argument) of the list stored
at destination
.destination
- must not be null.destinationPosition
- must not be null.RedisListCommands.Direction.first()
,
RedisListCommands.Direction.last()
@Nullable default E moveFirstTo(RedisList<E> destination, RedisListCommands.Direction destinationPosition, Duration timeout)
destinationPosition
argument) of the list stored
at destination
.
Blocks connection until element available or timeout
reached.destination
- must not be null.destinationPosition
- must not be null.timeout
- must not be null or negative.RedisListCommands.Direction.first()
,
RedisListCommands.Direction.last()
@Nullable E moveFirstTo(RedisList<E> destination, RedisListCommands.Direction destinationPosition, long timeout, TimeUnit unit)
destinationPosition
argument) of the list stored
at destination
.
Blocks connection until element available or timeout
reached.destination
- must not be null.destinationPosition
- must not be null.timeout
- unit
- must not be null.RedisListCommands.Direction.first()
,
RedisListCommands.Direction.last()
@Nullable E moveLastTo(RedisList<E> destination, RedisListCommands.Direction destinationPosition)
destinationPosition
argument) of the list stored
at destination
.destination
- must not be null.destinationPosition
- must not be null.RedisListCommands.Direction.first()
,
RedisListCommands.Direction.last()
@Nullable default E moveLastTo(RedisList<E> destination, RedisListCommands.Direction destinationPosition, Duration timeout)
destinationPosition
argument) of the list stored
at destination
.
Blocks connection until element available or timeout
reached.destination
- must not be null.destinationPosition
- must not be null.timeout
- must not be null or negative.RedisListCommands.Direction.first()
,
RedisListCommands.Direction.last()
@Nullable E moveLastTo(RedisList<E> destination, RedisListCommands.Direction destinationPosition, long timeout, TimeUnit unit)
destinationPosition
argument) of the list stored
at destination
.
Blocks connection until element available or timeout
reached.destination
- must not be null.destinationPosition
- must not be null.timeout
- unit
- must not be null.RedisListCommands.Direction.first()
,
RedisListCommands.Direction.last()
List<E> range(long start, long end)
start
and end
from list at the bound key.start
- end
- RedisList<E> trim(int start, int end)
start
and end
.start
- end
- RedisList<E> trim(long start, long end)
start
and end
.start
- end
- Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.