Interface RDeque<V>

Type Parameters:
V - the type of elements held in this collection
All Superinterfaces:
Collection<V>, Deque<V>, Iterable<V>, Queue<V>, RCollectionAsync<V>, RDequeAsync<V>, RExpirable, RExpirableAsync, RObject, RObjectAsync, RQueue<V>, RQueueAsync<V>, SequencedCollection<V>
All Known Subinterfaces:
RBlockingDeque<V>, RPriorityBlockingDeque<V>, RPriorityDeque<V>
All Known Implementing Classes:
RedissonBlockingDeque, RedissonDeque, RedissonPriorityBlockingDeque, RedissonPriorityDeque

public interface RDeque<V> extends Deque<V>, RQueue<V>, RDequeAsync<V>
Distributed implementation of Deque
Author:
Nikita Koksharov
  • Method Details

    • addFirstIfExists

      int addFirstIfExists(V... elements)
      Adds element at the head of existing deque.
      Parameters:
      elements - - elements to add
      Returns:
      length of the list
    • addFirst

      int addFirst(V... elements)
      Adds elements at the head of deque.
      Parameters:
      elements - - elements to add
      Returns:
      length of the deque
    • addLastIfExists

      int addLastIfExists(V... elements)
      Adds element at the tail of existing deque.
      Parameters:
      elements - - elements to add
      Returns:
      length of the list
    • addLast

      int addLast(V... elements)
      Adds elements at the tail of deque.
      Parameters:
      elements - - elements to add
      Returns:
      length of the deque
    • pollLast

      List<V> pollLast(int limit)
      Retrieves and removes the tail elements of this queue. Elements amount limited by limit param.
      Returns:
      list of tail elements
    • pollFirst

      List<V> pollFirst(int limit)
      Retrieves and removes the head elements of this queue. Elements amount limited by limit param.
      Returns:
      list of head elements
    • move

      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