public interface BitCommands
Modifier and Type | Method and Description |
---|---|
long |
bitcount(java.lang.String key)
Bitcount Command
Count the number of set bits (population counting) in a string.
|
long |
bitcount(java.lang.String key,
long start,
long end)
Bitcount Command
Count the number of set bits (population counting) in a string only in an interval start and end.
|
long |
bitcount(java.lang.String key,
long start,
long end,
BitCountOption option) |
java.util.List<java.lang.Long> |
bitfield(java.lang.String key,
java.lang.String... arguments)
Bitfield Command
The command treats a Redis string as an array of bits, and is capable of addressing specific integer
fields of varying bit widths and arbitrary non (necessary) aligned offset.
|
java.util.List<java.lang.Long> |
bitfieldReadonly(java.lang.String key,
java.lang.String... arguments)
The readonly version of
BITFIELD |
long |
bitop(BitOP op,
java.lang.String destKey,
java.lang.String... srcKeys)
Bitop Command
Perform a bitwise operation between multiple keys (containing string values) and store the result in the destKey.
|
long |
bitpos(java.lang.String key,
boolean value)
Bitpos Command
Return the position of the first bit set to 1 or 0 in a string.
|
long |
bitpos(java.lang.String key,
boolean value,
BitPosParams params)
Bitpos Command
Return the position of the first bit set to 1 or 0 in a string.
|
boolean |
getbit(java.lang.String key,
long offset)
GetBit Command
Returns the bit value at offset in the string value stored at key.
|
boolean |
setbit(java.lang.String key,
long offset,
boolean value)
SetBit Command
Sets or clears the bit at offset in the string value stored at key.
|
boolean setbit(java.lang.String key, long offset, boolean value)
Time complexity: O(1)
key
- offset
- value
- boolean getbit(java.lang.String key, long offset)
Time complexity: O(1)
key
- offset
- long bitcount(java.lang.String key)
key
- long bitcount(java.lang.String key, long start, long end)
Like for the GETRANGE command start and end can contain negative values in order to index bytes starting from the end of the string, where -1 is the last byte, -2 is the penultimate, and so forth.
key
- start
- byte start indexend
- byte end indexlong bitcount(java.lang.String key, long start, long end, BitCountOption option)
key
- start
- byte start indexend
- byte end indexoption
- indicate BYTE or BITbitcount(String, long, long)
long bitpos(java.lang.String key, boolean value)
key
- value
- the bit valuelong bitpos(java.lang.String key, boolean value, BitPosParams params)
key
- value
- the bit valueparams
- BitPosParams
java.util.List<java.lang.Long> bitfield(java.lang.String key, java.lang.String... arguments)
key
- arguments
- may be used with optional argumentsjava.util.List<java.lang.Long> bitfieldReadonly(java.lang.String key, java.lang.String... arguments)
BITFIELD
long bitop(BitOP op, java.lang.String destKey, java.lang.String... srcKeys)
op
- can be AND, OR, XOR or NOTdestKey
- srcKeys
- Copyright © 2023. All rights reserved.