Package org.redisson

Class RedissonBitSet

    • Method Detail

      • getSigned

        public long getSigned(int size,
                              long offset)
        Description copied from interface: RBitSet
        Returns signed number at specified offset and size
        Specified by:
        getSigned in interface RBitSet
        Parameters:
        size - - size of signed number up to 64 bits
        offset - - offset of signed number
        Returns:
        signed number
      • 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 defined value at specified offset
        Specified by:
        setSigned in interface RBitSet
        Parameters:
        size - - size of signed number up to 64 bits
        offset - - offset of signed number
        value - - value of signed number
        Returns:
        previous value of signed number
      • incrementAndGetSigned

        public long incrementAndGetSigned(int size,
                                          long offset,
                                          long increment)
        Description copied from interface: RBitSet
        Increments current signed value by defined increment value and size at specified offset and returns result.
        Specified by:
        incrementAndGetSigned in interface RBitSet
        Parameters:
        size - - size of signed number up to 64 bits
        offset - - offset of signed number
        increment - - increment value
        Returns:
        result value
      • getUnsigned

        public long getUnsigned(int size,
                                long offset)
        Description copied from interface: RBitSet
        Returns unsigned number at specified offset and size
        Specified by:
        getUnsigned in interface RBitSet
        Parameters:
        size - - size of unsigned number up to 64 bits
        offset - - 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 defined value at specified offset
        Specified by:
        setUnsigned in interface RBitSet
        Parameters:
        size - - size of unsigned number up to 64 bits
        offset - - offset of unsigned number
        value - - 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 defined increment value and size at specified offset and returns result.
        Specified by:
        incrementAndGetUnsigned in interface RBitSet
        Parameters:
        size - - size of unsigned number up to 64 bits
        offset - - offset of unsigned number
        increment - - increment value
        Returns:
        result value
      • getSignedAsync

        public RFuture<Long> getSignedAsync(int size,
                                            long offset)
        Description copied from interface: RBitSetAsync
        Returns signed number at specified offset and size
        Specified by:
        getSignedAsync in interface RBitSetAsync
        Parameters:
        size - - size of signed number up to 64 bits
        offset - - 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 defined value at specified offset
        Specified by:
        setSignedAsync in interface RBitSetAsync
        Parameters:
        size - - size of signed number up to 64 bits
        offset - - offset of signed number
        value - - 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 defined increment value and size at specified offset and returns result.
        Specified by:
        incrementAndGetSignedAsync in interface RBitSetAsync
        Parameters:
        size - - size of signed number up to 64 bits
        offset - - offset of signed number
        increment - - increment value
        Returns:
        result value
      • getUnsignedAsync

        public RFuture<Long> getUnsignedAsync(int size,
                                              long offset)
        Description copied from interface: RBitSetAsync
        Returns unsigned number at specified offset and size
        Specified by:
        getUnsignedAsync in interface RBitSetAsync
        Parameters:
        size - - size of unsigned number up to 63 bits
        offset - - 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 defined value at specified offset
        Specified by:
        setUnsignedAsync in interface RBitSetAsync
        Parameters:
        size - - size of unsigned number up to 63 bits
        offset - - offset of unsigned number
        value - - 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 defined increment value and size at specified offset and returns result.
        Specified by:
        incrementAndGetUnsignedAsync in interface RBitSetAsync
        Parameters:
        size - - size of unsigned number up to 63 bits
        offset - - offset of unsigned number
        increment - - increment value
        Returns:
        result value
      • getByte

        public byte getByte(long offset)
        Description copied from interface: RBitSet
        Returns byte number at specified offset
        Specified by:
        getByte in interface RBitSet
        Parameters:
        offset - - offset of number
        Returns:
        number
      • setByte

        public byte setByte(long offset,
                            byte value)
        Description copied from interface: RBitSet
        Returns previous value of byte number and replaces it with defined value at specified offset
        Specified by:
        setByte in interface RBitSet
        Parameters:
        offset - - offset of number
        value - - value of number
        Returns:
        previous value of number
      • incrementAndGetByte

        public byte incrementAndGetByte(long offset,
                                        byte increment)
        Description copied from interface: RBitSet
        Increments current byte value on defined increment value at specified offset and returns result.
        Specified by:
        incrementAndGetByte in interface RBitSet
        Parameters:
        offset - - offset of number
        increment - - increment value
        Returns:
        result value
      • getShort

        public short getShort(long offset)
        Description copied from interface: RBitSet
        Returns short number at specified offset
        Specified by:
        getShort in interface RBitSet
        Parameters:
        offset - - offset of number
        Returns:
        number
      • setShort

        public short setShort(long offset,
                              short value)
        Description copied from interface: RBitSet
        Returns previous value of short number and replaces it with defined value at specified offset
        Specified by:
        setShort in interface RBitSet
        Parameters:
        offset - - offset of number
        value - - value of number
        Returns:
        previous value of number
      • incrementAndGetShort

        public short incrementAndGetShort(long offset,
                                          short increment)
        Description copied from interface: RBitSet
        Increments current short value on defined increment value at specified offset and returns result.
        Specified by:
        incrementAndGetShort in interface RBitSet
        Parameters:
        offset - - offset of number
        increment - - increment value
        Returns:
        result value
      • getInteger

        public int getInteger(long offset)
        Description copied from interface: RBitSet
        Returns integer number at specified offset
        Specified by:
        getInteger in interface RBitSet
        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 defined value at specified offset
        Specified by:
        setInteger in interface RBitSet
        Parameters:
        offset - - offset of number
        value - - 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 defined increment value at specified offset and returns result.
        Specified by:
        incrementAndGetInteger in interface RBitSet
        Parameters:
        offset - - offset of number
        increment - - increment value
        Returns:
        result value
      • getLong

        public long getLong(long offset)
        Description copied from interface: RBitSet
        Returns long number at specified offset
        Specified by:
        getLong in interface RBitSet
        Parameters:
        offset - - offset of number
        Returns:
        number
      • setLong

        public long setLong(long offset,
                            long value)
        Description copied from interface: RBitSet
        Returns previous value of long number and replaces it with defined value at specified offset
        Specified by:
        setLong in interface RBitSet
        Parameters:
        offset - - offset of number
        value - - value of number
        Returns:
        previous value of number
      • incrementAndGetLong

        public long incrementAndGetLong(long offset,
                                        long increment)
        Description copied from interface: RBitSet
        Increments current long value on defined increment value at specified offset and returns result.
        Specified by:
        incrementAndGetLong in interface RBitSet
        Parameters:
        offset - - offset of number
        increment - - increment value
        Returns:
        result value
      • getByteAsync

        public RFuture<Byte> getByteAsync(long offset)
        Description copied from interface: RBitSetAsync
        Returns byte number at specified offset
        Specified by:
        getByteAsync in interface RBitSetAsync
        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 defined value at specified offset
        Specified by:
        setByteAsync in interface RBitSetAsync
        Parameters:
        offset - - offset of number
        value - - 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 defined increment value at specified offset and returns result.
        Specified by:
        incrementAndGetByteAsync in interface RBitSetAsync
        Parameters:
        offset - - offset of number
        increment - - increment value
        Returns:
        result value
      • getShortAsync

        public RFuture<Short> getShortAsync(long offset)
        Description copied from interface: RBitSetAsync
        Returns short number at specified offset
        Specified by:
        getShortAsync in interface RBitSetAsync
        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 defined value at specified offset
        Specified by:
        setShortAsync in interface RBitSetAsync
        Parameters:
        offset - - offset of number
        value - - 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 defined increment value at specified offset and returns result.
        Specified by:
        incrementAndGetShortAsync in interface RBitSetAsync
        Parameters:
        offset - - offset of number
        increment - - increment value
        Returns:
        result value
      • getIntegerAsync

        public RFuture<Integer> getIntegerAsync(long offset)
        Description copied from interface: RBitSetAsync
        Returns integer number at specified offset
        Specified by:
        getIntegerAsync in interface RBitSetAsync
        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 defined value at specified offset
        Specified by:
        setIntegerAsync in interface RBitSetAsync
        Parameters:
        offset - - offset of number
        value - - 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 defined increment value at specified offset and returns result.
        Specified by:
        incrementAndGetIntegerAsync in interface RBitSetAsync
        Parameters:
        offset - - offset of number
        increment - - increment value
        Returns:
        result value
      • getLongAsync

        public RFuture<Long> getLongAsync(long offset)
        Description copied from interface: RBitSetAsync
        Returns long number at specified offset
        Specified by:
        getLongAsync in interface RBitSetAsync
        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 defined value at specified offset
        Specified by:
        setLongAsync in interface RBitSetAsync
        Parameters:
        offset - - offset of number
        value - - 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 defined increment value at specified offset and returns result.
        Specified by:
        incrementAndGetLongAsync in interface RBitSetAsync
        Parameters:
        offset - - offset of number
        increment - - 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.
        Specified by:
        length in interface RBitSet
        Returns:
        "logical size" = index of highest set bit plus one
      • set

        public void set(BitSet bs)
        Description copied from interface: RBitSet
        Copy bits state of source BitSet object to this object
        Specified by:
        set in interface RBitSet
        Parameters:
        bs - - BitSet source
      • get

        public boolean get(long bitIndex)
        Description copied from interface: RBitSet
        Returns true if bit set to one and false overwise.
        Specified by:
        get in interface RBitSet
        Parameters:
        bitIndex - - index of bit
        Returns:
        true if bit set to one and false overwise.
      • getAsync

        public RFuture<Boolean> getAsync(long bitIndex)
        Description copied from interface: RBitSetAsync
        Returns true if bit set to one and false overwise.
        Specified by:
        getAsync in interface RBitSetAsync
        Parameters:
        bitIndex - - index of bit
        Returns:
        true if bit set to one and false overwise.
      • set

        public boolean set(long bitIndex)
        Description copied from interface: RBitSet
        Set bit to one at specified bitIndex
        Specified by:
        set in interface RBitSet
        Parameters:
        bitIndex - - index of bit
        Returns:
        true - if previous value was true, false - if previous value was false
      • set

        public void set(long fromIndex,
                        long toIndex,
                        boolean value)
        Description copied from interface: RBitSet
        Set all bits to value from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        set in interface RBitSet
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
        value - true = 1, false = 0
      • set

        public void set(long fromIndex,
                        long toIndex)
        Description copied from interface: RBitSet
        Set all bits to one from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        set in interface RBitSet
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
      • set

        public boolean set(long bitIndex,
                           boolean value)
        Description copied from interface: RBitSet
        Set bit to value at specified bitIndex
        Specified by:
        set in interface RBitSet
        Parameters:
        bitIndex - - index of bit
        value - true = 1, false = 0
        Returns:
        true - if previous value was true, false - if previous value was false
      • setAsync

        public RFuture<Boolean> setAsync(long bitIndex,
                                         boolean value)
        Description copied from interface: RBitSetAsync
        Set bit to value at specified bitIndex
        Specified by:
        setAsync in interface RBitSetAsync
        Parameters:
        bitIndex - - index of bit
        value - 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 interface RBitSet
      • cardinality

        public long cardinality()
        Description copied from interface: RBitSet
        Returns the number of bits set to one.
        Specified by:
        cardinality in interface RBitSet
        Returns:
        number of bits
      • size

        public long size()
        Description copied from interface: RBitSet
        Returns number of set bits.
        Specified by:
        size in 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 from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        clear in interface RBitSet
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
      • clear

        public boolean clear(long bitIndex)
        Description copied from interface: RBitSet
        Set bit to zero at specified bitIndex
        Specified by:
        clear in interface RBitSet
        Parameters:
        bitIndex - - index of bit
        Returns:
        true - if previous value was true, false - if previous value was false
      • clear

        public void clear()
        Description copied from interface: RBitSet
        Set all bits to zero
        Specified by:
        clear in interface RBitSet
      • 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.
        Specified by:
        or in interface RBitSet
        Parameters:
        bitSetNames - - name of stored bitsets
      • 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.
        Specified by:
        and in interface RBitSet
        Parameters:
        bitSetNames - - name of stored bitsets
      • 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.
        Specified by:
        xor in interface RBitSet
        Parameters:
        bitSetNames - - name of stored bitsets
      • not

        public void not()
        Description copied from interface: RBitSet
        Executes NOT operation over all bits
        Specified by:
        not in interface RBitSet
      • 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 interface RBitSetAsync
        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 to value from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        setAsync in interface RBitSetAsync
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
        value - 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 from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        clearAsync in interface RBitSetAsync
        Parameters:
        fromIndex - inclusive
        toIndex - 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 interface RBitSetAsync
        Parameters:
        bs - - BitSet source
        Returns:
        void
      • setAsync

        public RFuture<Void> setAsync(long fromIndex,
                                      long toIndex)
        Description copied from interface: RBitSetAsync
        Set all bits to one from fromIndex (inclusive) to toIndex (exclusive)
        Specified by:
        setAsync in interface RBitSetAsync
        Parameters:
        fromIndex - inclusive
        toIndex - exclusive
        Returns:
        void
      • setAsync

        public RFuture<Boolean> setAsync(long bitIndex)
        Description copied from interface: RBitSetAsync
        Set bit to one at specified bitIndex
        Specified by:
        setAsync in interface RBitSetAsync
        Parameters:
        bitIndex - - index of bit
        Returns:
        true - if previous value was true, false - if previous value was false
      • clearAsync

        public RFuture<Boolean> clearAsync(long bitIndex)
        Description copied from interface: RBitSetAsync
        Set bit to zero at specified bitIndex
        Specified by:
        clearAsync in interface RBitSetAsync
        Parameters:
        bitIndex - - index of bit
        Returns:
        true - if previous value was true, false - if previous value was false
      • 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 interface RBitSetAsync
        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 interface RBitSetAsync
        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 interface RBitSetAsync
        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 interface RExpirable
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false 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 interface RExpirableAsync
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAt

        public boolean expireAt(long timestamp)
        Description copied from interface: RExpirable
        Specified by:
        expireAt in interface RExpirable
        Parameters:
        timestamp - - expire date in milliseconds (Unix timestamp)
        Returns:
        true if the timeout was set and false 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 interface RExpirable
        Parameters:
        instant - - expire date
        Returns:
        true if the timeout was set and false 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 interface RExpirableAsync
        Parameters:
        instant - - expire date
        Returns:
        true if the timeout was set and false if not
      • clearExpire

        public boolean clearExpire()
        Description copied from interface: RExpirable
        Clear an expire timeout or expire date for object.
        Specified by:
        clearExpire in interface RExpirable
        Returns:
        true if timeout was removed false 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 interface RExpirableAsync
        Returns:
        true if the timeout was cleared and false 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 interface RExpirable
        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 interface RExpirableAsync
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.