Class VoidOutput<K,​V>

  • Type Parameters:
    K - Key type.
    V - Value type.

    public class VoidOutput<K,​V>
    extends CommandOutput<K,​V,​Void>
    Void command output to consume data silently without actually processing it. Creating VoidOutput.VoidCodec through its constructor will preserve its error decoding since decoding errors is stateful. Obtaining VoidOutput through create() will return an instance that does not decode errors.
    Since:
    6.0.2
    Author:
    Mark Paluch
    • Constructor Detail

      • VoidOutput

        public VoidOutput()
        Initialize a new instance that decodes errors.
      • VoidOutput

        public VoidOutput​(RedisCodec<K,​V> codec)
        Initialize a new instance that decodes errors.
        Parameters:
        codec - used for type inference, must not be null.
    • Method Detail

      • create

        public static <K,​V> VoidOutput<K,​V> create()
        Returns an instance of VoidOutput coerced to the expected generics. Since this codec does not decode any data at all, it's safe to use this way. Note that this method is only suitable for fire-and-forget usage since errors are not decoded.
        Type Parameters:
        K - Key type.
        V - Value type.
        Returns:
        the VoidOutput instance.
      • set

        public void set​(ByteBuffer bytes)
        Description copied from class: CommandOutput
        Update the command output with a sequence of bytes, or null. Concrete CommandOutput implementations must override this method to decode bulk/bytes response values.
        Overrides:
        set in class CommandOutput<K,​V,​Void>
        Parameters:
        bytes - The command output, or null.
      • set

        public void set​(long integer)
        Description copied from class: CommandOutput
        Update the command output with a 64-bit signed integer. Concrete CommandOutput implementations must override this method to decode number (integer) response values.
        Overrides:
        set in class CommandOutput<K,​V,​Void>
        Parameters:
        integer - The command output.
      • setSingle

        public void setSingle​(ByteBuffer bytes)
        Description copied from class: CommandOutput
        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.
        Overrides:
        setSingle in class CommandOutput<K,​V,​Void>
        Parameters:
        bytes - The command output, or null.
      • setBigNumber

        public void setBigNumber​(ByteBuffer bytes)
        Description copied from class: CommandOutput
        Update the command output with a big number. Concrete CommandOutput implementations must override this method to decode big number response values.
        Overrides:
        setBigNumber in class CommandOutput<K,​V,​Void>
        Parameters:
        bytes - The command output, or null.
      • set

        public void set​(double number)
        Description copied from class: CommandOutput
        Update the command output with a floating-point number. Concrete CommandOutput implementations must override this method to decode double response values.
        Overrides:
        set in class CommandOutput<K,​V,​Void>
        Parameters:
        number - The command output.
      • set

        public void set​(boolean value)
        Description copied from class: CommandOutput
        Update the command output with a boolean. Concrete CommandOutput implementations must override this method to decode boolean response values.
        Overrides:
        set in class CommandOutput<K,​V,​Void>
        Parameters:
        value - The command output.