Class BitFieldArgs

    • Constructor Detail

      • BitFieldArgs

        public BitFieldArgs()
    • Method Detail

      • get

        public BitFieldArgs get()
        Adds a new GET subcommand using offset 0 and the field type of the previous command.
        Returns:
        the current BitFieldArgs
        Throws:
        IllegalStateException - if no previous field type was found
      • get

        public BitFieldArgs get​(BitFieldArgs.BitFieldType bitFieldType)
        Adds a new GET subcommand using offset 0.
        Parameters:
        bitFieldType - the bit field type, must not be null.
        Returns:
        the current BitFieldArgs
      • get

        public BitFieldArgs get​(int offset)
        Adds a new GET subcommand using the field type of the previous command.
        Parameters:
        offset - bitfield offset
        Returns:
        a new GET subcommand for the given bitFieldType and offset.
        Throws:
        IllegalStateException - if no previous field type was found
      • get

        public BitFieldArgs get​(BitFieldArgs.BitFieldType bft,
                                int offset)
        Adds a new GET subcommand.
        Parameters:
        bft - the bit field type, must not be null.
        offset - bitfield offset
        Returns:
        the current BitFieldArgs
      • set

        public BitFieldArgs set​(BitFieldArgs.BitFieldType bft,
                                int offset,
                                long value)
        Adds a new SET subcommand.
        Parameters:
        bft - the bit field type, must not be null.
        offset - bitfield offset
        value - the value
        Returns:
        the current BitFieldArgs
      • set

        public BitFieldArgs set​(BitFieldArgs.BitFieldType bft,
                                BitFieldArgs.Offset offset,
                                long value)
        Adds a new SET subcommand.
        Parameters:
        bft - the bit field type, must not be null.
        offset - bitfield offset, must not be null.
        value - the value
        Returns:
        the current BitFieldArgs
      • set

        public BitFieldArgs set​(long value)
        Adds a new SET subcommand using offset 0 and the field type of the previous command.
        Parameters:
        value - the value
        Returns:
        the current BitFieldArgs
        Throws:
        IllegalStateException - if no previous field type was found
      • set

        public BitFieldArgs set​(BitFieldArgs.BitFieldType bitFieldType,
                                long value)
        Adds a new SET subcommand using offset 0.
        Parameters:
        bitFieldType - the bit field type, must not be null.
        value - the value
        Returns:
        the current BitFieldArgs
      • set

        public BitFieldArgs set​(int offset,
                                long value)
        Adds a new SET subcommand using the field type of the previous command.
        Parameters:
        offset - bitfield offset
        value - the value
        Returns:
        the current BitFieldArgs
        Throws:
        IllegalStateException - if no previous field type was found
      • incrBy

        public BitFieldArgs incrBy​(BitFieldArgs.BitFieldType bitFieldType,
                                   int offset,
                                   long value)
        Adds a new INCRBY subcommand.
        Parameters:
        bitFieldType - the bit field type, must not be null.
        offset - bitfield offset
        value - the value
        Returns:
        the current BitFieldArgs
      • incrBy

        public BitFieldArgs incrBy​(BitFieldArgs.BitFieldType bft,
                                   BitFieldArgs.Offset offset,
                                   long value)
        Adds a new INCRBY subcommand.
        Parameters:
        bft - the bit field type, must not be null.
        offset - bitfield offset, must not be null.
        value - the value
        Returns:
        the current BitFieldArgs
      • incrBy

        public BitFieldArgs incrBy​(int offset,
                                   long value)
        Adds a new INCRBY subcommand using the field type of the previous command.
        Parameters:
        offset - bitfield offset
        value - the value
        Returns:
        a new INCRBY subcommand for the given bitFieldType, offset and value.
        Throws:
        IllegalStateException - if no previous field type was found
      • incrBy

        public BitFieldArgs incrBy​(long value)
        Adds a new INCRBY subcommand using offset 0 and the field type of the previous command.
        Parameters:
        value - the value
        Returns:
        the current BitFieldArgs
        Throws:
        IllegalStateException - if no previous field type was found
      • incrBy

        public BitFieldArgs incrBy​(BitFieldArgs.BitFieldType bitFieldType,
                                   long value)
        Adds a new INCRBY subcommand using offset 0.
        Parameters:
        bitFieldType - the bit field type, must not be null.
        value - the value
        Returns:
        the current BitFieldArgs
      • overflow

        public BitFieldArgs overflow​(BitFieldArgs.OverflowType overflowType)
        Adds a new OVERFLOW subcommand.
        Parameters:
        overflowType - type of overflow, must not be null.
        Returns:
        the current BitFieldArgs
      • typeWidthBasedOffset

        public static BitFieldArgs.Offset typeWidthBasedOffset​(int offset)
        Creates a new BitFieldArgs.Offset for the given offset that is multiplied by the integer type width used in the sub command.
        Parameters:
        offset - offset to be multiplied by the integer type width.
        Returns:
        the BitFieldArgs.Offset.