Package org.redisson.api
Interface RDequeReactive<V>
-
- Type Parameters:
V- the type of elements held in this collection
- All Superinterfaces:
RCollectionReactive<V>,RExpirableReactive,RObjectReactive,RQueueReactive<V>
- All Known Subinterfaces:
RBlockingDequeReactive<V>
public interface RDequeReactive<V> extends RQueueReactive<V>
Reactive interface for Deque object- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description reactor.core.publisher.Mono<Void>addFirst(V e)Adds element at the head of this deque.reactor.core.publisher.Mono<Integer>addFirstIfExists(V... elements)Adds element at the head of existing deque.reactor.core.publisher.Mono<Void>addLast(V e)Adds element at the tail of this deque.reactor.core.publisher.Mono<Integer>addLastIfExists(V... elements)Adds element at the tail of existing deque.reactor.core.publisher.Flux<V>descendingIterator()reactor.core.publisher.Mono<V>getLast()Returns element at the tail of this deque ornullif there are no elements in deque.reactor.core.publisher.Mono<V>move(DequeMoveArgs args)Move element from this deque to the given destination deque.reactor.core.publisher.Mono<Boolean>offerFirst(V e)Adds element at the head of this deque.reactor.core.publisher.Mono<Boolean>offerLast(V e)Adds element at the tail of this deque.reactor.core.publisher.Mono<V>peekFirst()Returns element at the head of this deque ornullif there are no elements in deque.reactor.core.publisher.Mono<V>peekLast()Returns element at the tail of this deque ornullif there are no elements in deque.reactor.core.publisher.Mono<V>pollFirst()Retrieves and removes element at the head of this deque.reactor.core.publisher.Flux<V>pollFirst(int limit)Retrieves and removes the head elements of this queue.reactor.core.publisher.Mono<V>pollLast()Retrieves and removes element at the tail of this deque.reactor.core.publisher.Flux<V>pollLast(int limit)Retrieves and removes the tail elements of this queue.reactor.core.publisher.Mono<V>pop()Retrieves and removes element at the head of this deque.reactor.core.publisher.Mono<Void>push(V e)Adds element at the head of this deque.reactor.core.publisher.Mono<V>removeFirst()Retrieves and removes the first element of deque.reactor.core.publisher.Mono<Boolean>removeFirstOccurrence(Object o)Removes first occurrence of elementoreactor.core.publisher.Mono<V>removeLast()Retrieves and removes the last element of deque.reactor.core.publisher.Mono<Boolean>removeLastOccurrence(Object o)Removes last occurrence of elemento-
Methods inherited from interface org.redisson.api.RCollectionReactive
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size
-
Methods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expireAt, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectReactive
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RQueueReactive
offer, peek, poll, poll, pollLastAndOfferFirstTo, readAll
-
-
-
-
Method Detail
-
addFirstIfExists
reactor.core.publisher.Mono<Integer> addFirstIfExists(V... elements)
Adds element at the head of existing deque.- Parameters:
elements- - elements to add- Returns:
- length of the list
-
addLastIfExists
reactor.core.publisher.Mono<Integer> addLastIfExists(V... elements)
Adds element at the tail of existing deque.- Parameters:
elements- - elements to add- Returns:
- length of the list
-
descendingIterator
reactor.core.publisher.Flux<V> descendingIterator()
-
removeLastOccurrence
reactor.core.publisher.Mono<Boolean> removeLastOccurrence(Object o)
Removes last occurrence of elemento- Parameters:
o- - element- Returns:
trueif object has been removed otherwisefalse
-
removeLast
reactor.core.publisher.Mono<V> removeLast()
Retrieves and removes the last element of deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
removeFirst
reactor.core.publisher.Mono<V> removeFirst()
Retrieves and removes the first element of deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
removeFirstOccurrence
reactor.core.publisher.Mono<Boolean> removeFirstOccurrence(Object o)
Removes first occurrence of elemento- Parameters:
o- - element to remove- Returns:
trueif object has been removed otherwisefalse
-
push
reactor.core.publisher.Mono<Void> push(V e)
Adds element at the head of this deque.- Parameters:
e- - element to add- Returns:
- void
-
pop
reactor.core.publisher.Mono<V> pop()
Retrieves and removes element at the head of this deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
pollLast
reactor.core.publisher.Mono<V> pollLast()
Retrieves and removes element at the tail of this deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
pollFirst
reactor.core.publisher.Mono<V> pollFirst()
Retrieves and removes element at the head of this deque. Returnsnullif there are no elements in deque.- Returns:
- element
-
pollLast
reactor.core.publisher.Flux<V> pollLast(int limit)
Retrieves and removes the tail elements of this queue. Elements amount limited bylimitparam.- Returns:
- list of tail elements
-
pollFirst
reactor.core.publisher.Flux<V> pollFirst(int limit)
Retrieves and removes the head elements of this queue. Elements amount limited bylimitparam.- Returns:
- list of head elements
-
peekLast
reactor.core.publisher.Mono<V> peekLast()
Returns element at the tail of this deque ornullif there are no elements in deque.- Returns:
- element
-
peekFirst
reactor.core.publisher.Mono<V> peekFirst()
Returns element at the head of this deque ornullif there are no elements in deque.- Returns:
- element
-
offerLast
reactor.core.publisher.Mono<Boolean> offerLast(V e)
Adds element at the tail of this deque.- Parameters:
e- - element to add- Returns:
trueif element was added to this deque otherwisefalse
-
getLast
reactor.core.publisher.Mono<V> getLast()
Returns element at the tail of this deque ornullif there are no elements in deque.- Returns:
- element
-
addLast
reactor.core.publisher.Mono<Void> addLast(V e)
Adds element at the tail of this deque.- Parameters:
e- - element to add- Returns:
- void
-
addFirst
reactor.core.publisher.Mono<Void> addFirst(V e)
Adds element at the head of this deque.- Parameters:
e- - element to add- Returns:
- void
-
offerFirst
reactor.core.publisher.Mono<Boolean> offerFirst(V e)
Adds element at the head of this deque.- Parameters:
e- - element to add- Returns:
trueif element was added to this deque otherwisefalse
-
move
reactor.core.publisher.Mono<V> move(DequeMoveArgs args)
Move element from this deque to the given destination deque. Returns moved element.Usage examples:
V element = deque.move(DequeMoveArgs.pollLast() .addFirstTo("deque2"));V elements = deque.move(DequeMoveArgs.pollFirst() .addLastTo("deque2"));Requires Redis 6.2.0 and higher.
- Parameters:
args- - arguments object- Returns:
- moved element
-
-