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 classBitFieldArgs.BitFieldTypeRepresents a bit field type with details about signed/unsigned and the number of bits.static classBitFieldArgs.OffsetRepresents a bit field offset.static classBitFieldArgs.OverflowType
-
Constructor Summary
Constructors Constructor Description BitFieldArgs()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BitFieldArgsget()Adds a newGETsubcommand using offset0and the field type of the previous command.BitFieldArgsget(int offset)Adds a newGETsubcommand using the field type of the previous command.BitFieldArgsget(BitFieldArgs.BitFieldType bitFieldType)Adds a newGETsubcommand using offset0.BitFieldArgsget(BitFieldArgs.BitFieldType bft, int offset)Adds a newGETsubcommand.BitFieldArgsget(BitFieldArgs.BitFieldType bft, BitFieldArgs.Offset offset)Adds a newGETsubcommand.BitFieldArgsincrBy(int offset, long value)Adds a newINCRBYsubcommand using the field type of the previous command.BitFieldArgsincrBy(long value)Adds a newINCRBYsubcommand using offset0and the field type of the previous command.BitFieldArgsincrBy(BitFieldArgs.BitFieldType bitFieldType, int offset, long value)Adds a newINCRBYsubcommand.BitFieldArgsincrBy(BitFieldArgs.BitFieldType bitFieldType, long value)Adds a newINCRBYsubcommand using offset0.BitFieldArgsincrBy(BitFieldArgs.BitFieldType bft, BitFieldArgs.Offset offset, long value)Adds a newINCRBYsubcommand.static BitFieldArgs.Offsetoffset(int offset)Creates a newBitFieldArgs.Offsetfor the givenoffset.BitFieldArgsoverflow(BitFieldArgs.OverflowType overflowType)Adds a newOVERFLOWsubcommand.BitFieldArgsset(int offset, long value)Adds a newSETsubcommand using the field type of the previous command.BitFieldArgsset(long value)Adds a newSETsubcommand using offset0and the field type of the previous command.BitFieldArgsset(BitFieldArgs.BitFieldType bft, int offset, long value)Adds a newSETsubcommand.BitFieldArgsset(BitFieldArgs.BitFieldType bitFieldType, long value)Adds a newSETsubcommand using offset0.BitFieldArgsset(BitFieldArgs.BitFieldType bft, BitFieldArgs.Offset offset, long value)Adds a newSETsubcommand.static BitFieldArgs.BitFieldTypesigned(int bits)Creates a new signedBitFieldArgs.BitFieldTypefor the given number ofbits.List<String>toArgs()static BitFieldArgs.OffsettypeWidthBasedOffset(int offset)Creates a newBitFieldArgs.Offsetfor the givenoffsetthat is multiplied by the integer type width used in the sub command.static BitFieldArgs.BitFieldTypeunsigned(int bits)Creates a new unsignedBitFieldArgs.BitFieldTypefor 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 newGETsubcommand using offset0and 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 newGETsubcommand using offset0.- Parameters:
bitFieldType- the bit field type, must not benull.- Returns:
- the current
BitFieldArgs
-
get
public BitFieldArgs get(int offset)
Adds a newGETsubcommand using the field type of the previous command.- Parameters:
offset- bitfield offset- Returns:
- a new
GETsubcommand for the givenbitFieldTypeandoffset. - Throws:
IllegalStateException- if no previous field type was found
-
get
public BitFieldArgs get(BitFieldArgs.BitFieldType bft, int offset)
Adds a newGETsubcommand.- 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 newGETsubcommand.- 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 newSETsubcommand.- 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 newSETsubcommand.- 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 newSETsubcommand using offset0and 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 newSETsubcommand 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 newSETsubcommand 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 newINCRBYsubcommand.- 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 newINCRBYsubcommand.- 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 newINCRBYsubcommand using the field type of the previous command.- Parameters:
offset- bitfield offsetvalue- the value- Returns:
- a new
INCRBYsubcommand for the givenbitFieldType,offsetandvalue. - Throws:
IllegalStateException- if no previous field type was found
-
incrBy
public BitFieldArgs incrBy(long value)
Adds a newINCRBYsubcommand using offset0and 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 newINCRBYsubcommand 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 newOVERFLOWsubcommand.- Parameters:
overflowType- type of overflow, must not benull.- Returns:
- the current
BitFieldArgs
-
signed
public static BitFieldArgs.BitFieldType signed(int bits)
Creates a new signedBitFieldArgs.BitFieldTypefor the given number ofbits. Redis allows up to64bits 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.BitFieldTypefor the given number ofbits. Redis allows up to63bits 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.Offsetfor the givenoffset.- Parameters:
offset- zero-based offset.- Returns:
- the
BitFieldArgs.Offset.
-
typeWidthBasedOffset
public static BitFieldArgs.Offset typeWidthBasedOffset(int offset)
Creates a newBitFieldArgs.Offsetfor the givenoffsetthat 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:
toArgsin interfaceRedisCommandExtraArguments- Returns:
- the list of arguments, encoded as a list of String.
-
-