Class CommandOutput<K,​V,​T>

    • Constructor Summary

      Constructors 
      Constructor Description
      CommandOutput​(RedisCodec<K,​V> codec, T output)
      Initialize a new instance that encodes and decodes keys and values using the supplied codec.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void complete​(int depth)
      Mark the command output complete.
      protected String decodeAscii​(ByteBuffer bytes)  
      T get()
      Get the command output.
      String getError()
      Get the error that occurred.
      boolean hasError()
      Check if the command resulted in an error.
      void multi​(int count)
      Mark the beginning of a multi sequence (array).
      void multiArray​(int count)
      Mark the beginning of a multi sequence (array).
      void multiMap​(int count)
      Mark the beginning of a multi sequence (map).
      void multiPush​(int count)
      Mark the beginning of a multi sequence (push-array).
      void multiSet​(int count)
      Mark the beginning of a set.
      void set​(boolean value)
      Update the command output with a boolean.
      void set​(double number)
      Update the command output with a floating-point number.
      void set​(long integer)
      Update the command output with a 64-bit signed integer.
      void set​(ByteBuffer bytes)
      Update the command output with a sequence of bytes, or null.
      void setBigNumber​(ByteBuffer bytes)
      Update the command output with a big number.
      void setError​(String error)
      Set command output to an error message from the client.
      void setError​(ByteBuffer error)
      Set command output to an error message from the server.
      void setSingle​(ByteBuffer bytes)
      Update the command output with a sequence of bytes, or null representing a simple string.
      String toString()  
    • Field Detail

      • output

        protected T output
      • error

        protected String error
    • Constructor Detail

      • CommandOutput

        public CommandOutput​(RedisCodec<K,​V> codec,
                             T output)
        Initialize a new instance that encodes and decodes keys and values using the supplied codec.
        Parameters:
        codec - Codec used to encode/decode keys and values, must not be null.
        output - Initial value of output.
    • Method Detail

      • get

        public T get()
        Get the command output.
        Returns:
        The command output.
      • set

        public void set​(ByteBuffer bytes)
        Update the command output with a sequence of bytes, or null. Concrete CommandOutput implementations must override this method to decode bulk/bytes response values.
        Parameters:
        bytes - The command output, or null.
      • setSingle

        public void setSingle​(ByteBuffer bytes)
        Update the command output with a sequence of bytes, or null representing a simple string. Concrete CommandOutput implementations must override this method to decode single/bytes response values.
        Parameters:
        bytes - The command output, or null.
      • setBigNumber

        public void setBigNumber​(ByteBuffer bytes)
        Update the command output with a big number. Concrete CommandOutput implementations must override this method to decode big number response values.
        Parameters:
        bytes - The command output, or null.
        Since:
        6.0/RESP 3
      • set

        public void set​(long integer)
        Update the command output with a 64-bit signed integer. Concrete CommandOutput implementations must override this method to decode number (integer) response values.
        Parameters:
        integer - The command output.
      • set

        public void set​(double number)
        Update the command output with a floating-point number. Concrete CommandOutput implementations must override this method to decode double response values.
        Parameters:
        number - The command output.
        Since:
        6.0/RESP 3
      • set

        public void set​(boolean value)
        Update the command output with a boolean. Concrete CommandOutput implementations must override this method to decode boolean response values.
        Parameters:
        value - The command output.
        Since:
        6.0/RESP 3
      • setError

        public void setError​(ByteBuffer error)
        Set command output to an error message from the server.
        Parameters:
        error - Error message.
      • setError

        public void setError​(String error)
        Set command output to an error message from the client.
        Parameters:
        error - Error message.
      • hasError

        public boolean hasError()
        Check if the command resulted in an error.
        Returns:
        true if command resulted in an error.
      • getError

        public String getError()
        Get the error that occurred.
        Returns:
        The error.
      • complete

        public void complete​(int depth)
        Mark the command output complete.
        Parameters:
        depth - Remaining depth of output queue.
      • multi

        public void multi​(int count)
        Mark the beginning of a multi sequence (array).
        Parameters:
        count - expected number of elements in this multi sequence.
      • multiArray

        public void multiArray​(int count)
        Mark the beginning of a multi sequence (array).
        Parameters:
        count - expected number of elements in this multi sequence.
        Since:
        6.0/RESP 3
      • multiPush

        public void multiPush​(int count)
        Mark the beginning of a multi sequence (push-array).
        Parameters:
        count - expected number of elements in this multi sequence.
        Since:
        6.0/RESP 3
      • multiMap

        public void multiMap​(int count)
        Mark the beginning of a multi sequence (map).
        Parameters:
        count - expected number of elements in this multi sequence.
        Since:
        6.0/RESP 3
      • multiSet

        public void multiSet​(int count)
        Mark the beginning of a set.
        Parameters:
        count - expected number of elements in this multi sequence.
        Since:
        6.0/RESP 3