Interface RDeque<V>

    • Method Detail

      • addFirstIfExists

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

        int addLastIfExists​(V... elements)
        Adds element at the tail of existing deque.
        Parameters:
        elements - - elements to add
        Returns:
        length of the list
      • 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