Package org.redisson

Class RedissonAtomicDouble

    • Method Detail

      • addAndGet

        public double addAndGet​(double delta)
        Description copied from interface: RAtomicDouble
        Atomically adds the given value to the current value.
        Specified by:
        addAndGet in interface RAtomicDouble
        Parameters:
        delta - the value to add
        Returns:
        the updated value
      • compareAndSet

        public boolean compareAndSet​(double expect,
                                     double update)
        Description copied from interface: RAtomicDouble
        Atomically sets the value to the given updated value only if the current value == the expected value.
        Specified by:
        compareAndSet in interface RAtomicDouble
        Parameters:
        expect - the expected value
        update - the new value
        Returns:
        true if successful; or false if the actual value was not equal to the expected value.
      • compareAndSetAsync

        public RFuture<Boolean> compareAndSetAsync​(double expect,
                                                   double update)
        Description copied from interface: RAtomicDoubleAsync
        Atomically sets the value to the given updated value only if the current value == the expected value.
        Specified by:
        compareAndSetAsync in interface RAtomicDoubleAsync
        Parameters:
        expect - the expected value
        update - the new value
        Returns:
        true if successful; or false if the actual value was not equal to the expected value.
      • decrementAndGet

        public double decrementAndGet()
        Description copied from interface: RAtomicDouble
        Atomically decrements the current value by one.
        Specified by:
        decrementAndGet in interface RAtomicDouble
        Returns:
        the updated value
      • get

        public double get()
        Description copied from interface: RAtomicDouble
        Returns current value.
        Specified by:
        get in interface RAtomicDouble
        Returns:
        current value
      • getAndDelete

        public double getAndDelete()
        Description copied from interface: RAtomicDouble
        Returns and deletes object
        Specified by:
        getAndDelete in interface RAtomicDouble
        Returns:
        the current value
      • getAndAdd

        public double getAndAdd​(double delta)
        Description copied from interface: RAtomicDouble
        Atomically adds the given value to the current value.
        Specified by:
        getAndAdd in interface RAtomicDouble
        Parameters:
        delta - the value to add
        Returns:
        the old value before the add
      • getAndSet

        public double getAndSet​(double newValue)
        Description copied from interface: RAtomicDouble
        Atomically sets the given value and returns the old value.
        Specified by:
        getAndSet in interface RAtomicDouble
        Parameters:
        newValue - the new value
        Returns:
        the old value
      • incrementAndGet

        public double incrementAndGet()
        Description copied from interface: RAtomicDouble
        Atomically increments the current value by one.
        Specified by:
        incrementAndGet in interface RAtomicDouble
        Returns:
        the updated value
      • getAndIncrement

        public double getAndIncrement()
        Description copied from interface: RAtomicDouble
        Atomically increments the current value by one.
        Specified by:
        getAndIncrement in interface RAtomicDouble
        Returns:
        the old value
      • getAndDecrement

        public double getAndDecrement()
        Description copied from interface: RAtomicDouble
        Atomically decrements by one the current value.
        Specified by:
        getAndDecrement in interface RAtomicDouble
        Returns:
        the previous value
      • set

        public void set​(double newValue)
        Description copied from interface: RAtomicDouble
        Atomically sets the given value.
        Specified by:
        set in interface RAtomicDouble
        Parameters:
        newValue - the new value
      • 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.