Class BitFieldArgs

java.lang.Object
io.quarkus.redis.datasource.bitmap.BitFieldArgs
All Implemented Interfaces:
RedisCommandExtraArguments

public class BitFieldArgs extends Object implements RedisCommandExtraArguments
  • Constructor Details

    • BitFieldArgs

      public BitFieldArgs()
  • Method Details

    • 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
    • get

      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
    • signed

      public static BitFieldArgs.BitFieldType signed(int bits)
      Creates a new signed BitFieldArgs.BitFieldType for the given number of bits. Redis allows up to 64 bits for unsigned integers.
      Parameters:
      bits - number of bits to define the integer type width.
      Returns:
      the BitFieldArgs.BitFieldType.
    • unsigned

      public static BitFieldArgs.BitFieldType unsigned(int bits)
      Creates a new unsigned BitFieldArgs.BitFieldType for the given number of bits. Redis allows up to 63 bits for unsigned integers.
      Parameters:
      bits - number of bits to define the integer type width.
      Returns:
      the BitFieldArgs.BitFieldType.
    • offset

      public static BitFieldArgs.Offset offset(int offset)
      Creates a new BitFieldArgs.Offset for the given offset.
      Parameters:
      offset - zero-based offset.
      Returns:
      the BitFieldArgs.Offset.
    • 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.
    • toArgs

      public List<Object> toArgs()
      Specified by:
      toArgs in interface RedisCommandExtraArguments
      Returns:
      the list of arguments.