Interface RExpirable

    • Method Detail

      • expire

        boolean expire(long timeToLive,
                       TimeUnit timeUnit)
        Set a timeout for object. After the timeout has expired, the key will automatically be deleted.
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAt

        @Deprecated
        boolean expireAt(long timestamp)
        Deprecated.
        Use expire(Instant) instead
        Parameters:
        timestamp - - expire date in milliseconds (Unix timestamp)
        Returns:
        true if the timeout was set and false if not
      • expireAt

        @Deprecated
        boolean expireAt(Date timestamp)
        Deprecated.
        Use expire(Instant) instead
        Parameters:
        timestamp - - expire date
        Returns:
        true if the timeout was set and false if not
      • expire

        boolean expire(Instant instant)
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Parameters:
        instant - - expire date
        Returns:
        true if the timeout was set and false if not
      • clearExpire

        boolean clearExpire()
        Clear an expire timeout or expire date for object.
        Returns:
        true if timeout was removed false if object does not exist or does not have an associated timeout
      • remainTimeToLive

        long remainTimeToLive()
        Remaining time to live of Redisson object that has a timeout
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.