Package org.redisson
Class RedissonBitSet
- java.lang.Object
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonBitSet
-
- All Implemented Interfaces:
RBitSet
,RBitSetAsync
,RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
public class RedissonBitSet extends RedissonObject implements RBitSet
- Author:
- Nikita Koksharov
-
-
Field Summary
-
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
-
Constructor Summary
Constructors Constructor Description RedissonBitSet(CommandAsyncExecutor connectionManager, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
and(String... bitSetNames)
Executes AND operation over this object and specified bitsets.RFuture<Void>
andAsync(String... bitSetNames)
Executes AND operation over this object and specified bitsets.BitSet
asBitSet()
long
cardinality()
Returns the number of bits set to one.RFuture<Long>
cardinalityAsync()
Returns the number of bits set to one.void
clear()
Set all bits to zeroboolean
clear(long bitIndex)
Set bit to zero at specifiedbitIndex
void
clear(long fromIndex, long toIndex)
Set all bits to zero fromfromIndex
(inclusive) totoIndex
(exclusive)RFuture<Void>
clearAsync()
Set all bits to zeroRFuture<Boolean>
clearAsync(long bitIndex)
Set bit to zero at specifiedbitIndex
RFuture<Void>
clearAsync(long fromIndex, long toIndex)
Set all bits to zero fromfromIndex
(inclusive) totoIndex
(exclusive)boolean
clearExpire()
Clear an expire timeout or expire date for object.RFuture<Boolean>
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.protected RFuture<Boolean>
clearExpireAsync(String... keys)
boolean
expire(long timeToLive, TimeUnit timeUnit)
Set a timeout for object.boolean
expire(Instant instant)
Set an expire date for object.RFuture<Boolean>
expireAsync(long timeToLive, TimeUnit timeUnit)
Set a timeout for object in async mode.protected RFuture<Boolean>
expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
RFuture<Boolean>
expireAsync(Instant instant)
Set an expire date for object.boolean
expireAt(long timestamp)
UseRExpirable.expire(Instant)
insteadboolean
expireAt(Date timestamp)
UseRExpirable.expire(Instant)
insteadRFuture<Boolean>
expireAtAsync(long timestamp)
UseRExpirableAsync.expireAsync(Instant)
insteadprotected RFuture<Boolean>
expireAtAsync(long timestamp, String... keys)
RFuture<Boolean>
expireAtAsync(Date timestamp)
UseRExpirableAsync.expireAsync(Instant)
insteadboolean
get(long bitIndex)
Returnstrue
if bit set to one andfalse
overwise.RFuture<Boolean>
getAsync(long bitIndex)
Returnstrue
if bit set to one andfalse
overwise.byte
getByte(long offset)
Returns byte number at specifiedoffset
RFuture<Byte>
getByteAsync(long offset)
Returns byte number at specifiedoffset
int
getInteger(long offset)
Returns integer number at specifiedoffset
RFuture<Integer>
getIntegerAsync(long offset)
Returns integer number at specifiedoffset
long
getLong(long offset)
Returns long number at specifiedoffset
RFuture<Long>
getLongAsync(long offset)
Returns long number at specifiedoffset
short
getShort(long offset)
Returns short number at specifiedoffset
RFuture<Short>
getShortAsync(long offset)
Returns short number at specifiedoffset
long
getSigned(int size, long offset)
Returns signed number at specifiedoffset
andsize
RFuture<Long>
getSignedAsync(int size, long offset)
Returns signed number at specifiedoffset
andsize
long
getUnsigned(int size, long offset)
Returns unsigned number at specifiedoffset
andsize
RFuture<Long>
getUnsignedAsync(int size, long offset)
Returns unsigned number at specifiedoffset
andsize
byte
incrementAndGetByte(long offset, byte increment)
Increments current byte value on definedincrement
value at specifiedoffset
and returns result.RFuture<Byte>
incrementAndGetByteAsync(long offset, byte increment)
Increments current byte value on definedincrement
value at specifiedoffset
and returns result.int
incrementAndGetInteger(long offset, int increment)
Increments current integer value on definedincrement
value at specifiedoffset
and returns result.RFuture<Integer>
incrementAndGetIntegerAsync(long offset, int increment)
Increments current integer value on definedincrement
value at specifiedoffset
and returns result.long
incrementAndGetLong(long offset, long increment)
Increments current long value on definedincrement
value at specifiedoffset
and returns result.RFuture<Long>
incrementAndGetLongAsync(long offset, long increment)
Increments current long value on definedincrement
value at specifiedoffset
and returns result.short
incrementAndGetShort(long offset, short increment)
Increments current short value on definedincrement
value at specifiedoffset
and returns result.RFuture<Short>
incrementAndGetShortAsync(long offset, short increment)
Increments current short value on definedincrement
value at specifiedoffset
and returns result.long
incrementAndGetSigned(int size, long offset, long increment)
Increments current signed value by definedincrement
value andsize
at specifiedoffset
and returns result.RFuture<Long>
incrementAndGetSignedAsync(int size, long offset, long increment)
Increments current signed value by definedincrement
value andsize
at specifiedoffset
and returns result.long
incrementAndGetUnsigned(int size, long offset, long increment)
Increments current unsigned value by definedincrement
value andsize
at specifiedoffset
and returns result.RFuture<Long>
incrementAndGetUnsignedAsync(int size, long offset, long increment)
Increments current unsigned value by definedincrement
value andsize
at specifiedoffset
and returns result.long
length()
Returns "logical size" = index of highest set bit plus one.RFuture<Long>
lengthAsync()
Returns "logical size" = index of highest set bit plus one.void
not()
Executes NOT operation over all bitsRFuture<Void>
notAsync()
Executes NOT operation over all bitsvoid
or(String... bitSetNames)
Executes OR operation over this object and specified bitsets.RFuture<Void>
orAsync(String... bitSetNames)
Executes OR operation over this object and specified bitsets.long
remainTimeToLive()
Remaining time to live of Redisson object that has a timeoutRFuture<Long>
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeoutboolean
set(long bitIndex)
Set bit to one at specified bitIndexboolean
set(long bitIndex, boolean value)
Set bit tovalue
at specifiedbitIndex
void
set(long fromIndex, long toIndex)
Set all bits to one fromfromIndex
(inclusive) totoIndex
(exclusive)void
set(long fromIndex, long toIndex, boolean value)
Set all bits tovalue
fromfromIndex
(inclusive) totoIndex
(exclusive)void
set(BitSet bs)
Copy bits state of source BitSet object to this objectRFuture<Boolean>
setAsync(long bitIndex)
Set bit to one at specified bitIndexRFuture<Boolean>
setAsync(long bitIndex, boolean value)
Set bit tovalue
at specifiedbitIndex
RFuture<Void>
setAsync(long fromIndex, long toIndex)
Set all bits to one fromfromIndex
(inclusive) totoIndex
(exclusive)RFuture<Void>
setAsync(long fromIndex, long toIndex, boolean value)
Set all bits tovalue
fromfromIndex
(inclusive) totoIndex
(exclusive)RFuture<Void>
setAsync(BitSet bs)
Copy bits state of source BitSet object to this objectbyte
setByte(long offset, byte value)
Returns previous value of byte number and replaces it with definedvalue
at specifiedoffset
RFuture<Byte>
setByteAsync(long offset, byte value)
Returns previous value of byte number and replaces it with definedvalue
at specifiedoffset
int
setInteger(long offset, int value)
Returns previous value of integer number and replaces it with definedvalue
at specifiedoffset
RFuture<Integer>
setIntegerAsync(long offset, int value)
Returns previous value of integer number and replaces it with definedvalue
at specifiedoffset
long
setLong(long offset, long value)
Returns previous value of long number and replaces it with definedvalue
at specifiedoffset
RFuture<Long>
setLongAsync(long offset, long value)
Returns previous value of long number and replaces it with definedvalue
at specifiedoffset
short
setShort(long offset, short value)
Returns previous value of short number and replaces it with definedvalue
at specifiedoffset
RFuture<Short>
setShortAsync(long offset, short value)
Returns previous value of short number and replaces it with definedvalue
at specifiedoffset
long
setSigned(int size, long offset, long value)
Returns previous value of signed number and replaces it with definedvalue
at specifiedoffset
RFuture<Long>
setSignedAsync(int size, long offset, long value)
Returns previous value of signed number and replaces it with definedvalue
at specifiedoffset
long
setUnsigned(int size, long offset, long value)
Returns previous value of unsigned number and replaces it with definedvalue
at specifiedoffset
RFuture<Long>
setUnsignedAsync(int size, long offset, long value)
Returns previous value of unsigned number and replaces it with definedvalue
at specifiedoffset
long
size()
Returns number of set bits.RFuture<Long>
sizeAsync()
Returns number of set bits.byte[]
toByteArray()
RFuture<byte[]>
toByteArrayAsync()
protected int
toInt(boolean value)
String
toString()
void
xor(String... bitSetNames)
Executes XOR operation over this object and specified bitsets.RFuture<Void>
xorAsync(String... bitSetNames)
Executes XOR operation over this object and specified bitsets.-
Methods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObject
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
-
-
-
Constructor Detail
-
RedissonBitSet
public RedissonBitSet(CommandAsyncExecutor connectionManager, String name)
-
-
Method Detail
-
getSigned
public long getSigned(int size, long offset)
Description copied from interface:RBitSet
Returns signed number at specifiedoffset
andsize
-
setSigned
public long setSigned(int size, long offset, long value)
Description copied from interface:RBitSet
Returns previous value of signed number and replaces it with definedvalue
at specifiedoffset
-
incrementAndGetSigned
public long incrementAndGetSigned(int size, long offset, long increment)
Description copied from interface:RBitSet
Increments current signed value by definedincrement
value andsize
at specifiedoffset
and returns result.- Specified by:
incrementAndGetSigned
in interfaceRBitSet
- Parameters:
size
- - size of signed number up to 64 bitsoffset
- - offset of signed numberincrement
- - increment value- Returns:
- result value
-
getUnsigned
public long getUnsigned(int size, long offset)
Description copied from interface:RBitSet
Returns unsigned number at specifiedoffset
andsize
- Specified by:
getUnsigned
in interfaceRBitSet
- Parameters:
size
- - size of unsigned number up to 64 bitsoffset
- - offset of unsigned number- Returns:
- unsigned number
-
setUnsigned
public long setUnsigned(int size, long offset, long value)
Description copied from interface:RBitSet
Returns previous value of unsigned number and replaces it with definedvalue
at specifiedoffset
- Specified by:
setUnsigned
in interfaceRBitSet
- Parameters:
size
- - size of unsigned number up to 64 bitsoffset
- - offset of unsigned numbervalue
- - value of unsigned number- Returns:
- previous value of unsigned number
-
incrementAndGetUnsigned
public long incrementAndGetUnsigned(int size, long offset, long increment)
Description copied from interface:RBitSet
Increments current unsigned value by definedincrement
value andsize
at specifiedoffset
and returns result.- Specified by:
incrementAndGetUnsigned
in interfaceRBitSet
- Parameters:
size
- - size of unsigned number up to 64 bitsoffset
- - offset of unsigned numberincrement
- - increment value- Returns:
- result value
-
getSignedAsync
public RFuture<Long> getSignedAsync(int size, long offset)
Description copied from interface:RBitSetAsync
Returns signed number at specifiedoffset
andsize
- Specified by:
getSignedAsync
in interfaceRBitSetAsync
- Parameters:
size
- - size of signed number up to 64 bitsoffset
- - offset of signed number- Returns:
- signed number
-
setSignedAsync
public RFuture<Long> setSignedAsync(int size, long offset, long value)
Description copied from interface:RBitSetAsync
Returns previous value of signed number and replaces it with definedvalue
at specifiedoffset
- Specified by:
setSignedAsync
in interfaceRBitSetAsync
- Parameters:
size
- - size of signed number up to 64 bitsoffset
- - offset of signed numbervalue
- - value of signed number- Returns:
- previous value of signed number
-
incrementAndGetSignedAsync
public RFuture<Long> incrementAndGetSignedAsync(int size, long offset, long increment)
Description copied from interface:RBitSetAsync
Increments current signed value by definedincrement
value andsize
at specifiedoffset
and returns result.- Specified by:
incrementAndGetSignedAsync
in interfaceRBitSetAsync
- Parameters:
size
- - size of signed number up to 64 bitsoffset
- - offset of signed numberincrement
- - increment value- Returns:
- result value
-
getUnsignedAsync
public RFuture<Long> getUnsignedAsync(int size, long offset)
Description copied from interface:RBitSetAsync
Returns unsigned number at specifiedoffset
andsize
- Specified by:
getUnsignedAsync
in interfaceRBitSetAsync
- Parameters:
size
- - size of unsigned number up to 63 bitsoffset
- - offset of unsigned number- Returns:
- unsigned number
-
setUnsignedAsync
public RFuture<Long> setUnsignedAsync(int size, long offset, long value)
Description copied from interface:RBitSetAsync
Returns previous value of unsigned number and replaces it with definedvalue
at specifiedoffset
- Specified by:
setUnsignedAsync
in interfaceRBitSetAsync
- Parameters:
size
- - size of unsigned number up to 63 bitsoffset
- - offset of unsigned numbervalue
- - value of unsigned number- Returns:
- previous value of unsigned number
-
incrementAndGetUnsignedAsync
public RFuture<Long> incrementAndGetUnsignedAsync(int size, long offset, long increment)
Description copied from interface:RBitSetAsync
Increments current unsigned value by definedincrement
value andsize
at specifiedoffset
and returns result.- Specified by:
incrementAndGetUnsignedAsync
in interfaceRBitSetAsync
- Parameters:
size
- - size of unsigned number up to 63 bitsoffset
- - offset of unsigned numberincrement
- - increment value- Returns:
- result value
-
getByte
public byte getByte(long offset)
Description copied from interface:RBitSet
Returns byte number at specifiedoffset
-
setByte
public byte setByte(long offset, byte value)
Description copied from interface:RBitSet
Returns previous value of byte number and replaces it with definedvalue
at specifiedoffset
-
incrementAndGetByte
public byte incrementAndGetByte(long offset, byte increment)
Description copied from interface:RBitSet
Increments current byte value on definedincrement
value at specifiedoffset
and returns result.- Specified by:
incrementAndGetByte
in interfaceRBitSet
- Parameters:
offset
- - offset of numberincrement
- - increment value- Returns:
- result value
-
getShort
public short getShort(long offset)
Description copied from interface:RBitSet
Returns short number at specifiedoffset
-
setShort
public short setShort(long offset, short value)
Description copied from interface:RBitSet
Returns previous value of short number and replaces it with definedvalue
at specifiedoffset
-
incrementAndGetShort
public short incrementAndGetShort(long offset, short increment)
Description copied from interface:RBitSet
Increments current short value on definedincrement
value at specifiedoffset
and returns result.- Specified by:
incrementAndGetShort
in interfaceRBitSet
- Parameters:
offset
- - offset of numberincrement
- - increment value- Returns:
- result value
-
getInteger
public int getInteger(long offset)
Description copied from interface:RBitSet
Returns integer number at specifiedoffset
- Specified by:
getInteger
in interfaceRBitSet
- Parameters:
offset
- - offset of number- Returns:
- number
-
setInteger
public int setInteger(long offset, int value)
Description copied from interface:RBitSet
Returns previous value of integer number and replaces it with definedvalue
at specifiedoffset
- Specified by:
setInteger
in interfaceRBitSet
- Parameters:
offset
- - offset of numbervalue
- - value of number- Returns:
- previous value of number
-
incrementAndGetInteger
public int incrementAndGetInteger(long offset, int increment)
Description copied from interface:RBitSet
Increments current integer value on definedincrement
value at specifiedoffset
and returns result.- Specified by:
incrementAndGetInteger
in interfaceRBitSet
- Parameters:
offset
- - offset of numberincrement
- - increment value- Returns:
- result value
-
getLong
public long getLong(long offset)
Description copied from interface:RBitSet
Returns long number at specifiedoffset
-
setLong
public long setLong(long offset, long value)
Description copied from interface:RBitSet
Returns previous value of long number and replaces it with definedvalue
at specifiedoffset
-
incrementAndGetLong
public long incrementAndGetLong(long offset, long increment)
Description copied from interface:RBitSet
Increments current long value on definedincrement
value at specifiedoffset
and returns result.- Specified by:
incrementAndGetLong
in interfaceRBitSet
- Parameters:
offset
- - offset of numberincrement
- - increment value- Returns:
- result value
-
getByteAsync
public RFuture<Byte> getByteAsync(long offset)
Description copied from interface:RBitSetAsync
Returns byte number at specifiedoffset
- Specified by:
getByteAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of number- Returns:
- number
-
setByteAsync
public RFuture<Byte> setByteAsync(long offset, byte value)
Description copied from interface:RBitSetAsync
Returns previous value of byte number and replaces it with definedvalue
at specifiedoffset
- Specified by:
setByteAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of numbervalue
- - value of number- Returns:
- previous value of number
-
incrementAndGetByteAsync
public RFuture<Byte> incrementAndGetByteAsync(long offset, byte increment)
Description copied from interface:RBitSetAsync
Increments current byte value on definedincrement
value at specifiedoffset
and returns result.- Specified by:
incrementAndGetByteAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of numberincrement
- - increment value- Returns:
- result value
-
getShortAsync
public RFuture<Short> getShortAsync(long offset)
Description copied from interface:RBitSetAsync
Returns short number at specifiedoffset
- Specified by:
getShortAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of number- Returns:
- number
-
setShortAsync
public RFuture<Short> setShortAsync(long offset, short value)
Description copied from interface:RBitSetAsync
Returns previous value of short number and replaces it with definedvalue
at specifiedoffset
- Specified by:
setShortAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of numbervalue
- - value of number- Returns:
- previous value of number
-
incrementAndGetShortAsync
public RFuture<Short> incrementAndGetShortAsync(long offset, short increment)
Description copied from interface:RBitSetAsync
Increments current short value on definedincrement
value at specifiedoffset
and returns result.- Specified by:
incrementAndGetShortAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of numberincrement
- - increment value- Returns:
- result value
-
getIntegerAsync
public RFuture<Integer> getIntegerAsync(long offset)
Description copied from interface:RBitSetAsync
Returns integer number at specifiedoffset
- Specified by:
getIntegerAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of number- Returns:
- number
-
setIntegerAsync
public RFuture<Integer> setIntegerAsync(long offset, int value)
Description copied from interface:RBitSetAsync
Returns previous value of integer number and replaces it with definedvalue
at specifiedoffset
- Specified by:
setIntegerAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of numbervalue
- - value of number- Returns:
- previous value of number
-
incrementAndGetIntegerAsync
public RFuture<Integer> incrementAndGetIntegerAsync(long offset, int increment)
Description copied from interface:RBitSetAsync
Increments current integer value on definedincrement
value at specifiedoffset
and returns result.- Specified by:
incrementAndGetIntegerAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of numberincrement
- - increment value- Returns:
- result value
-
getLongAsync
public RFuture<Long> getLongAsync(long offset)
Description copied from interface:RBitSetAsync
Returns long number at specifiedoffset
- Specified by:
getLongAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of number- Returns:
- number
-
setLongAsync
public RFuture<Long> setLongAsync(long offset, long value)
Description copied from interface:RBitSetAsync
Returns previous value of long number and replaces it with definedvalue
at specifiedoffset
- Specified by:
setLongAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of numbervalue
- - value of number- Returns:
- previous value of number
-
incrementAndGetLongAsync
public RFuture<Long> incrementAndGetLongAsync(long offset, long increment)
Description copied from interface:RBitSetAsync
Increments current long value on definedincrement
value at specifiedoffset
and returns result.- Specified by:
incrementAndGetLongAsync
in interfaceRBitSetAsync
- Parameters:
offset
- - offset of numberincrement
- - increment value- Returns:
- result value
-
length
public long length()
Description copied from interface:RBitSet
Returns "logical size" = index of highest set bit plus one. Returns zero if there are no any set bit.
-
set
public void set(BitSet bs)
Description copied from interface:RBitSet
Copy bits state of source BitSet object to this object
-
get
public boolean get(long bitIndex)
Description copied from interface:RBitSet
Returnstrue
if bit set to one andfalse
overwise.
-
getAsync
public RFuture<Boolean> getAsync(long bitIndex)
Description copied from interface:RBitSetAsync
Returnstrue
if bit set to one andfalse
overwise.- Specified by:
getAsync
in interfaceRBitSetAsync
- Parameters:
bitIndex
- - index of bit- Returns:
true
if bit set to one andfalse
overwise.
-
set
public boolean set(long bitIndex)
Description copied from interface:RBitSet
Set bit to one at specified bitIndex
-
set
public void set(long fromIndex, long toIndex, boolean value)
Description copied from interface:RBitSet
Set all bits tovalue
fromfromIndex
(inclusive) totoIndex
(exclusive)
-
set
public void set(long fromIndex, long toIndex)
Description copied from interface:RBitSet
Set all bits to one fromfromIndex
(inclusive) totoIndex
(exclusive)
-
set
public boolean set(long bitIndex, boolean value)
Description copied from interface:RBitSet
Set bit tovalue
at specifiedbitIndex
-
setAsync
public RFuture<Boolean> setAsync(long bitIndex, boolean value)
Description copied from interface:RBitSetAsync
Set bit tovalue
at specifiedbitIndex
- Specified by:
setAsync
in interfaceRBitSetAsync
- Parameters:
bitIndex
- - index of bitvalue
- true = 1, false = 0- Returns:
true
- if previous value was true,false
- if previous value was false
-
toInt
protected int toInt(boolean value)
-
toByteArray
public byte[] toByteArray()
- Specified by:
toByteArray
in interfaceRBitSet
-
toByteArrayAsync
public RFuture<byte[]> toByteArrayAsync()
- Specified by:
toByteArrayAsync
in interfaceRBitSetAsync
-
cardinality
public long cardinality()
Description copied from interface:RBitSet
Returns the number of bits set to one.- Specified by:
cardinality
in interfaceRBitSet
- Returns:
- number of bits
-
size
public long size()
Description copied from interface:RBitSet
Returns number of set bits.
-
clear
public void clear(long fromIndex, long toIndex)
Description copied from interface:RBitSet
Set all bits to zero fromfromIndex
(inclusive) totoIndex
(exclusive)
-
clear
public boolean clear(long bitIndex)
Description copied from interface:RBitSet
Set bit to zero at specifiedbitIndex
-
clear
public void clear()
Description copied from interface:RBitSet
Set all bits to zero
-
or
public void or(String... bitSetNames)
Description copied from interface:RBitSet
Executes OR operation over this object and specified bitsets. Stores result into this object.
-
and
public void and(String... bitSetNames)
Description copied from interface:RBitSet
Executes AND operation over this object and specified bitsets. Stores result into this object.
-
xor
public void xor(String... bitSetNames)
Description copied from interface:RBitSet
Executes XOR operation over this object and specified bitsets. Stores result into this object.
-
not
public void not()
Description copied from interface:RBitSet
Executes NOT operation over all bits
-
lengthAsync
public RFuture<Long> lengthAsync()
Description copied from interface:RBitSetAsync
Returns "logical size" = index of highest set bit plus one. Returns zero if there are no any set bit.- Specified by:
lengthAsync
in interfaceRBitSetAsync
- Returns:
- "logical size" = index of highest set bit plus one
-
setAsync
public RFuture<Void> setAsync(long fromIndex, long toIndex, boolean value)
Description copied from interface:RBitSetAsync
Set all bits tovalue
fromfromIndex
(inclusive) totoIndex
(exclusive)- Specified by:
setAsync
in interfaceRBitSetAsync
- Parameters:
fromIndex
- inclusivetoIndex
- exclusivevalue
- true = 1, false = 0- Returns:
- void
-
clearAsync
public RFuture<Void> clearAsync(long fromIndex, long toIndex)
Description copied from interface:RBitSetAsync
Set all bits to zero fromfromIndex
(inclusive) totoIndex
(exclusive)- Specified by:
clearAsync
in interfaceRBitSetAsync
- Parameters:
fromIndex
- inclusivetoIndex
- exclusive- Returns:
- void
-
setAsync
public RFuture<Void> setAsync(BitSet bs)
Description copied from interface:RBitSetAsync
Copy bits state of source BitSet object to this object- Specified by:
setAsync
in interfaceRBitSetAsync
- Parameters:
bs
- - BitSet source- Returns:
- void
-
notAsync
public RFuture<Void> notAsync()
Description copied from interface:RBitSetAsync
Executes NOT operation over all bits- Specified by:
notAsync
in interfaceRBitSetAsync
- Returns:
- void
-
setAsync
public RFuture<Void> setAsync(long fromIndex, long toIndex)
Description copied from interface:RBitSetAsync
Set all bits to one fromfromIndex
(inclusive) totoIndex
(exclusive)- Specified by:
setAsync
in interfaceRBitSetAsync
- Parameters:
fromIndex
- inclusivetoIndex
- exclusive- Returns:
- void
-
sizeAsync
public RFuture<Long> sizeAsync()
Description copied from interface:RBitSetAsync
Returns number of set bits.- Specified by:
sizeAsync
in interfaceRBitSetAsync
- Returns:
- number of set bits.
-
setAsync
public RFuture<Boolean> setAsync(long bitIndex)
Description copied from interface:RBitSetAsync
Set bit to one at specified bitIndex- Specified by:
setAsync
in interfaceRBitSetAsync
- Parameters:
bitIndex
- - index of bit- Returns:
true
- if previous value was true,false
- if previous value was false
-
cardinalityAsync
public RFuture<Long> cardinalityAsync()
Description copied from interface:RBitSetAsync
Returns the number of bits set to one.- Specified by:
cardinalityAsync
in interfaceRBitSetAsync
- Returns:
- number of bits
-
clearAsync
public RFuture<Boolean> clearAsync(long bitIndex)
Description copied from interface:RBitSetAsync
Set bit to zero at specifiedbitIndex
- Specified by:
clearAsync
in interfaceRBitSetAsync
- Parameters:
bitIndex
- - index of bit- Returns:
true
- if previous value was true,false
- if previous value was false
-
clearAsync
public RFuture<Void> clearAsync()
Description copied from interface:RBitSetAsync
Set all bits to zero- Specified by:
clearAsync
in interfaceRBitSetAsync
- Returns:
- void
-
orAsync
public RFuture<Void> orAsync(String... bitSetNames)
Description copied from interface:RBitSetAsync
Executes OR operation over this object and specified bitsets. Stores result into this object.- Specified by:
orAsync
in interfaceRBitSetAsync
- Parameters:
bitSetNames
- - name of stored bitsets- Returns:
- void
-
andAsync
public RFuture<Void> andAsync(String... bitSetNames)
Description copied from interface:RBitSetAsync
Executes AND operation over this object and specified bitsets. Stores result into this object.- Specified by:
andAsync
in interfaceRBitSetAsync
- Parameters:
bitSetNames
- - name of stored bitsets- Returns:
- void
-
xorAsync
public RFuture<Void> xorAsync(String... bitSetNames)
Description copied from interface:RBitSetAsync
Executes XOR operation over this object and specified bitsets. Stores result into this object.- Specified by:
xorAsync
in interfaceRBitSetAsync
- Parameters:
bitSetNames
- - name of stored bitsets- Returns:
- void
-
expire
public boolean expire(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirable
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirableAsync
Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp)
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(long timestamp)
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expire
public boolean expire(Instant instant)
Description copied from interface:RExpirable
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
public RFuture<Boolean> expireAsync(Instant instant)
Description copied from interface:RExpirableAsync
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(Date timestamp)
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(Date timestamp)
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()
Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
clearExpireAsync
public RFuture<Boolean> clearExpireAsync()
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
remainTimeToLive
public long remainTimeToLive()
Description copied from interface:RExpirable
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLive
in interfaceRExpirable
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
public RFuture<Long> remainTimeToLiveAsync()
Description copied from interface:RExpirableAsync
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsync
in interfaceRExpirableAsync
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
expireAsync
protected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
-
-