Class BitFieldArgs
- java.lang.Object
-
- io.quarkus.redis.datasource.bitmap.BitFieldArgs
-
- All Implemented Interfaces:
RedisCommandExtraArguments
public class BitFieldArgs extends Object implements RedisCommandExtraArguments
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BitFieldArgs.BitFieldType
Represents a bit field type with details about signed/unsigned and the number of bits.static class
BitFieldArgs.Offset
Represents a bit field offset.static class
BitFieldArgs.OverflowType
-
Constructor Summary
Constructors Constructor Description BitFieldArgs()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BitFieldArgs
get()
Adds a newGET
subcommand using offset0
and the field type of the previous command.BitFieldArgs
get(int offset)
Adds a newGET
subcommand using the field type of the previous command.BitFieldArgs
get(BitFieldArgs.BitFieldType bitFieldType)
Adds a newGET
subcommand using offset0
.BitFieldArgs
get(BitFieldArgs.BitFieldType bft, int offset)
Adds a newGET
subcommand.BitFieldArgs
get(BitFieldArgs.BitFieldType bft, BitFieldArgs.Offset offset)
Adds a newGET
subcommand.BitFieldArgs
incrBy(int offset, long value)
Adds a newINCRBY
subcommand using the field type of the previous command.BitFieldArgs
incrBy(long value)
Adds a newINCRBY
subcommand using offset0
and the field type of the previous command.BitFieldArgs
incrBy(BitFieldArgs.BitFieldType bitFieldType, int offset, long value)
Adds a newINCRBY
subcommand.BitFieldArgs
incrBy(BitFieldArgs.BitFieldType bitFieldType, long value)
Adds a newINCRBY
subcommand using offset0
.BitFieldArgs
incrBy(BitFieldArgs.BitFieldType bft, BitFieldArgs.Offset offset, long value)
Adds a newINCRBY
subcommand.static BitFieldArgs.Offset
offset(int offset)
Creates a newBitFieldArgs.Offset
for the givenoffset
.BitFieldArgs
overflow(BitFieldArgs.OverflowType overflowType)
Adds a newOVERFLOW
subcommand.BitFieldArgs
set(int offset, long value)
Adds a newSET
subcommand using the field type of the previous command.BitFieldArgs
set(long value)
Adds a newSET
subcommand using offset0
and the field type of the previous command.BitFieldArgs
set(BitFieldArgs.BitFieldType bft, int offset, long value)
Adds a newSET
subcommand.BitFieldArgs
set(BitFieldArgs.BitFieldType bitFieldType, long value)
Adds a newSET
subcommand using offset0
.BitFieldArgs
set(BitFieldArgs.BitFieldType bft, BitFieldArgs.Offset offset, long value)
Adds a newSET
subcommand.static BitFieldArgs.BitFieldType
signed(int bits)
Creates a new signedBitFieldArgs.BitFieldType
for the given number ofbits
.List<String>
toArgs()
static BitFieldArgs.Offset
typeWidthBasedOffset(int offset)
Creates a newBitFieldArgs.Offset
for the givenoffset
that is multiplied by the integer type width used in the sub command.static BitFieldArgs.BitFieldType
unsigned(int bits)
Creates a new unsignedBitFieldArgs.BitFieldType
for the given number ofbits
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.redis.datasource.RedisCommandExtraArguments
toArgs
-
-
-
-
Method Detail
-
get
public BitFieldArgs get()
Adds a newGET
subcommand using offset0
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 newGET
subcommand using offset0
.- Parameters:
bitFieldType
- the bit field type, must not benull
.- Returns:
- the current
BitFieldArgs
-
get
public BitFieldArgs get(int offset)
Adds a newGET
subcommand using the field type of the previous command.- Parameters:
offset
- bitfield offset- Returns:
- a new
GET
subcommand for the givenbitFieldType
andoffset
. - Throws:
IllegalStateException
- if no previous field type was found
-
get
public BitFieldArgs get(BitFieldArgs.BitFieldType bft, int offset)
Adds a newGET
subcommand.- Parameters:
bft
- the bit field type, must not benull
.offset
- bitfield offset- Returns:
- the current
BitFieldArgs
-
get
public BitFieldArgs get(BitFieldArgs.BitFieldType bft, BitFieldArgs.Offset offset)
Adds a newGET
subcommand.- Parameters:
bft
- the bit field type, must not benull
.offset
- bitfield offset- Returns:
- the current
BitFieldArgs
-
set
public BitFieldArgs set(BitFieldArgs.BitFieldType bft, int offset, long value)
Adds a newSET
subcommand.- Parameters:
bft
- the bit field type, must not benull
.offset
- bitfield offsetvalue
- the value- Returns:
- the current
BitFieldArgs
-
set
public BitFieldArgs set(BitFieldArgs.BitFieldType bft, BitFieldArgs.Offset offset, long value)
Adds a newSET
subcommand.- Parameters:
bft
- the bit field type, must not benull
.offset
- bitfield offset, must not benull
.value
- the value- Returns:
- the current
BitFieldArgs
-
set
public BitFieldArgs set(long value)
Adds a newSET
subcommand using offset0
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 newSET
subcommand using offset0
.- Parameters:
bitFieldType
- the bit field type, must not benull
.value
- the value- Returns:
- the current
BitFieldArgs
-
set
public BitFieldArgs set(int offset, long value)
Adds a newSET
subcommand using the field type of the previous command.- Parameters:
offset
- bitfield offsetvalue
- 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 newINCRBY
subcommand.- Parameters:
bitFieldType
- the bit field type, must not benull
.offset
- bitfield offsetvalue
- the value- Returns:
- the current
BitFieldArgs
-
incrBy
public BitFieldArgs incrBy(BitFieldArgs.BitFieldType bft, BitFieldArgs.Offset offset, long value)
Adds a newINCRBY
subcommand.- Parameters:
bft
- the bit field type, must not benull
.offset
- bitfield offset, must not benull
.value
- the value- Returns:
- the current
BitFieldArgs
-
incrBy
public BitFieldArgs incrBy(int offset, long value)
Adds a newINCRBY
subcommand using the field type of the previous command.- Parameters:
offset
- bitfield offsetvalue
- the value- Returns:
- a new
INCRBY
subcommand for the givenbitFieldType
,offset
andvalue
. - Throws:
IllegalStateException
- if no previous field type was found
-
incrBy
public BitFieldArgs incrBy(long value)
Adds a newINCRBY
subcommand using offset0
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 newINCRBY
subcommand using offset0
.- Parameters:
bitFieldType
- the bit field type, must not benull
.value
- the value- Returns:
- the current
BitFieldArgs
-
overflow
public BitFieldArgs overflow(BitFieldArgs.OverflowType overflowType)
Adds a newOVERFLOW
subcommand.- Parameters:
overflowType
- type of overflow, must not benull
.- Returns:
- the current
BitFieldArgs
-
signed
public static BitFieldArgs.BitFieldType signed(int bits)
Creates a new signedBitFieldArgs.BitFieldType
for the given number ofbits
. Redis allows up to64
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 unsignedBitFieldArgs.BitFieldType
for the given number ofbits
. Redis allows up to63
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 newBitFieldArgs.Offset
for the givenoffset
.- Parameters:
offset
- zero-based offset.- Returns:
- the
BitFieldArgs.Offset
.
-
typeWidthBasedOffset
public static BitFieldArgs.Offset typeWidthBasedOffset(int offset)
Creates a newBitFieldArgs.Offset
for the givenoffset
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<String> toArgs()
- Specified by:
toArgs
in interfaceRedisCommandExtraArguments
- Returns:
- the list of arguments, encoded as a list of String.
-
-