Package org.redisson

Class RedissonLexSortedSet

All Implemented Interfaces:
Iterable<String>, Collection<String>, Set<String>, SortedSet<String>, RCollectionAsync<String>, RExpirable, RExpirableAsync, RLexSortedSet, RLexSortedSetAsync, RObject, RObjectAsync, RScoredSortedSet<String>, RScoredSortedSetAsync<String>, RSortable<Set<String>>, RSortableAsync<Set<String>>, RSortedSet<String>

public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implements RLexSortedSet
Sorted set contained values of String type
Author:
Nikita Koksharov
  • Constructor Details

  • Method Details

    • removeRange

      public int removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSet
      Removes values range starting with fromElement and ending with toElement.
      Specified by:
      removeRange in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      number of elements removed
    • removeRangeHead

      public int removeRangeHead(String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSet
      Removes head values range ending with toElement.
      Specified by:
      removeRangeHead in interface RLexSortedSet
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      number of elements removed
    • removeRangeHeadAsync

      public RFuture<Integer> removeRangeHeadAsync(String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSetAsync
      Removes head values range ending with toElement.
      Specified by:
      removeRangeHeadAsync in interface RLexSortedSetAsync
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      number of elements removed
    • removeRangeTail

      public int removeRangeTail(String fromElement, boolean fromInclusive)
      Description copied from interface: RLexSortedSet
      Removes tail values range starting with fromElement.
      Specified by:
      removeRangeTail in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      Returns:
      number of elements removed
    • removeRangeTailAsync

      public RFuture<Integer> removeRangeTailAsync(String fromElement, boolean fromInclusive)
      Description copied from interface: RLexSortedSetAsync
      Removes tail values range starting with fromElement.
      Specified by:
      removeRangeTailAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      Returns:
      number of elements removed
    • removeRangeAsync

      public RFuture<Integer> removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSetAsync
      Removes values range starting with fromElement and ending with toElement.
      Specified by:
      removeRangeAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      number of elements removed
    • range

      public Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSet
      Returns values range starting with fromElement and ending with toElement.
      Specified by:
      range in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      collection of elements
    • rangeHead

      public Collection<String> rangeHead(String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSet
      Returns head values range ending with toElement.
      Specified by:
      rangeHead in interface RLexSortedSet
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      collection of elements
    • rangeHeadAsync

      public RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSetAsync
      Returns head values range ending with toElement.
      Specified by:
      rangeHeadAsync in interface RLexSortedSetAsync
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      collection of elements
    • rangeTail

      public Collection<String> rangeTail(String fromElement, boolean fromInclusive)
      Description copied from interface: RLexSortedSet
      Returns tail values range starting with fromElement.
      Specified by:
      rangeTail in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      Returns:
      collection of elements
    • rangeTailAsync

      public RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive)
      Description copied from interface: RLexSortedSetAsync
      Returns tail values range starting with fromElement.
      Specified by:
      rangeTailAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      Returns:
      collection of elements
    • rangeAsync

      public RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSetAsync
      Returns values range starting with fromElement and ending with toElement.
      Specified by:
      rangeAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      collection of elements
    • range

      public Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
      Description copied from interface: RLexSortedSet
      Returns values range starting with fromElement and ending with toElement. Returned collection limited by count and starts with offset.
      Specified by:
      range in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeHead

      public Collection<String> rangeHead(String toElement, boolean toInclusive, int offset, int count)
      Description copied from interface: RLexSortedSet
      Returns head values range ending with toElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeHead in interface RLexSortedSet
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeHeadAsync

      public RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count)
      Description copied from interface: RLexSortedSetAsync
      Returns head values range ending with toElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeHeadAsync in interface RLexSortedSetAsync
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeTail

      public Collection<String> rangeTail(String fromElement, boolean fromInclusive, int offset, int count)
      Description copied from interface: RLexSortedSet
      Returns tail values range starting with fromElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeTail in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeTailAsync

      public RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count)
      Description copied from interface: RLexSortedSetAsync
      Returns tail values range starting with fromElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeTailAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeAsync

      public RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
      Description copied from interface: RLexSortedSetAsync
      Returns values range starting with fromElement and ending with toElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeTailReversed

      public Collection<String> rangeTailReversed(String fromElement, boolean fromInclusive)
      Description copied from interface: RLexSortedSet
      Returns tail values range in reverse order starting with fromElement.
      Specified by:
      rangeTailReversed in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      Returns:
      collection of elements
    • rangeHeadReversed

      public Collection<String> rangeHeadReversed(String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSet
      Returns head values range in reverse order ending with toElement.
      Specified by:
      rangeHeadReversed in interface RLexSortedSet
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      collection of elements
    • rangeReversed

      public Collection<String> rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSet
      Returns values range in reverse order starting with fromElement and ending with toElement.
      Specified by:
      rangeReversed in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      collection of elements
    • rangeTailReversed

      public Collection<String> rangeTailReversed(String fromElement, boolean fromInclusive, int offset, int count)
      Description copied from interface: RLexSortedSet
      Returns tail values range in reverse order starting with fromElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeTailReversed in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeHeadReversed

      public Collection<String> rangeHeadReversed(String toElement, boolean toInclusive, int offset, int count)
      Description copied from interface: RLexSortedSet
      Returns head values range in reverse order ending with toElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeHeadReversed in interface RLexSortedSet
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeReversed

      public Collection<String> rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
      Description copied from interface: RLexSortedSet
      Returns values range in reverse order starting with fromElement and ending with toElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeReversed in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeTailReversedAsync

      public RFuture<Collection<String>> rangeTailReversedAsync(String fromElement, boolean fromInclusive)
      Description copied from interface: RLexSortedSetAsync
      Returns tail values range in reverse order starting with fromElement.
      Specified by:
      rangeTailReversedAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      Returns:
      collection of elements
    • rangeHeadReversedAsync

      public RFuture<Collection<String>> rangeHeadReversedAsync(String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSetAsync
      Returns head values range in reverse order ending with toElement.
      Specified by:
      rangeHeadReversedAsync in interface RLexSortedSetAsync
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      collection of elements
    • rangeReversedAsync

      public RFuture<Collection<String>> rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSetAsync
      Returns values range in reverse order starting with fromElement and ending with toElement.
      Specified by:
      rangeReversedAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      collection of elements
    • rangeTailReversedAsync

      public RFuture<Collection<String>> rangeTailReversedAsync(String fromElement, boolean fromInclusive, int offset, int count)
      Description copied from interface: RLexSortedSetAsync
      Returns tail values range in reverse order starting with fromElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeTailReversedAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeHeadReversedAsync

      public RFuture<Collection<String>> rangeHeadReversedAsync(String toElement, boolean toInclusive, int offset, int count)
      Description copied from interface: RLexSortedSetAsync
      Returns head values range in reverse order ending with toElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeHeadReversedAsync in interface RLexSortedSetAsync
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • rangeReversedAsync

      public RFuture<Collection<String>> rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
      Description copied from interface: RLexSortedSetAsync
      Returns values range in reverse order starting with fromElement and ending with toElement. Returned collection limited by count and starts with offset.
      Specified by:
      rangeReversedAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      offset - - offset of result collection
      count - - amount of result collection
      Returns:
      collection of elements
    • countTail

      public int countTail(String fromElement, boolean fromInclusive)
      Description copied from interface: RLexSortedSet
      Returns the number of tail values starting with fromElement.
      Specified by:
      countTail in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      Returns:
      number of elements
    • countTailAsync

      public RFuture<Integer> countTailAsync(String fromElement, boolean fromInclusive)
      Description copied from interface: RLexSortedSetAsync
      Returns the number of tail values starting with fromElement.
      Specified by:
      countTailAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      Returns:
      number of elements
    • countHead

      public int countHead(String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSet
      Returns the number of head values ending with toElement.
      Specified by:
      countHead in interface RLexSortedSet
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      number of elements
    • countHeadAsync

      public RFuture<Integer> countHeadAsync(String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSetAsync
      Returns the number of head values ending with toElement.
      Specified by:
      countHeadAsync in interface RLexSortedSetAsync
      Parameters:
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      number of elements
    • count

      public int count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSet
      Returns the number of elements between fromElement and toElement.
      Specified by:
      count in interface RLexSortedSet
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      number of elements
    • countAsync

      public RFuture<Integer> countAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
      Description copied from interface: RLexSortedSetAsync
      Returns the number of elements between fromElement and toElement.
      Specified by:
      countAsync in interface RLexSortedSetAsync
      Parameters:
      fromElement - - start element
      fromInclusive - - start element inclusive
      toElement - - end element
      toInclusive - - end element inclusive
      Returns:
      number of elements
    • addAsync

      public RFuture<Boolean> addAsync(String e)
      Description copied from interface: RCollectionAsync
      Adds element into this collection.
      Specified by:
      addAsync in interface RCollectionAsync<String>
      Specified by:
      addAsync in interface RSortedSet<String>
      Parameters:
      e - - element to add
      Returns:
      true if an element was added and false if it is already present
    • addAllAsync

      public RFuture<Boolean> addAllAsync(Collection<? extends String> c)
      Description copied from interface: RCollectionAsync
      Adds all elements contained in the specified collection
      Specified by:
      addAllAsync in interface RCollectionAsync<String>
      Parameters:
      c - - collection of elements to add
      Returns:
      true if at least one element was added and false if all elements are already present
    • add

      public boolean add(String e)
      Specified by:
      add in interface Collection<String>
      Specified by:
      add in interface Set<String>
    • addAll

      public boolean addAll(Collection<? extends String> c)
      Specified by:
      addAll in interface Collection<String>
      Specified by:
      addAll in interface Set<String>
    • range

      public Collection<String> range(int startIndex, int endIndex)
      Description copied from interface: RLexSortedSet
      Returns values by rank range. Indexes are zero based. -1 means the highest score, -2 means the second highest score.
      Specified by:
      range in interface RLexSortedSet
      Parameters:
      startIndex - - start index
      endIndex - - end index
      Returns:
      collection of elements
    • rangeAsync

      public RFuture<Collection<String>> rangeAsync(int startIndex, int endIndex)
      Description copied from interface: RLexSortedSetAsync
      Returns values by rank range. Indexes are zero based. -1 means the highest score, -2 means the second highest score.
      Specified by:
      rangeAsync in interface RLexSortedSetAsync
      Parameters:
      startIndex - - start index
      endIndex - - end index
      Returns:
      collection of elements
    • trySetComparator

      public boolean trySetComparator(Comparator<? super String> comparator)
      Description copied from interface: RSortedSet
      Sets new comparator only if current set is empty
      Specified by:
      trySetComparator in interface RSortedSet<String>
      Parameters:
      comparator - for values
      Returns:
      true if new comparator setted false otherwise
    • distributedIterator

      public Iterator<String> distributedIterator(String iteratorName, int count)
      Description copied from interface: RSortedSet
      Returns iterator over elements that match specified pattern. Iterator can be shared across multiple applications. Creating multiple iterators on the same object with this method will result in a single shared iterator. Iterator name must be resolved to the same hash slot as list name.
      Specified by:
      distributedIterator in interface RSortedSet<String>
      Parameters:
      iteratorName - redis object name to which cursor will be saved
      count - batch size
      Returns:
      shared elements iterator
    • comparator

      public Comparator<? super String> comparator()
      Specified by:
      comparator in interface SortedSet<String>
    • subSet

      public SortedSet<String> subSet(String fromElement, String toElement)
      Specified by:
      subSet in interface SortedSet<String>
    • headSet

      public SortedSet<String> headSet(String toElement)
      Specified by:
      headSet in interface SortedSet<String>
    • tailSet

      public SortedSet<String> tailSet(String fromElement)
      Specified by:
      tailSet in interface SortedSet<String>
    • expire

      public boolean expire(long timeToLive, TimeUnit timeUnit)
      Description copied from interface: RExpirable
      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
      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
    • expireAtAsync

      public RFuture<Boolean> expireAtAsync(long timestamp)
      Description copied from interface: RExpirableAsync
      Specified by:
      expireAtAsync in interface RExpirableAsync
      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
      Sets an expiration date for this 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
    • expireIfSet

      public boolean expireIfSet(Instant time)
      Description copied from interface: RExpirable
      Sets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.

      Requires Redis 7.0.0 and higher.

      Specified by:
      expireIfSet in interface RExpirable
      Parameters:
      time - expire date
      Returns:
      true if the timeout was set and false if not
    • expireIfSetAsync

      public RFuture<Boolean> expireIfSetAsync(Instant time)
      Specified by:
      expireIfSetAsync in interface RExpirableAsync
    • expireIfNotSet

      public boolean expireIfNotSet(Instant time)
      Description copied from interface: RExpirable
      Sets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.

      Requires Redis 7.0.0 and higher.

      Specified by:
      expireIfNotSet in interface RExpirable
      Parameters:
      time - expire date
      Returns:
      true if the timeout was set and false if not
    • expireIfNotSetAsync

      public RFuture<Boolean> expireIfNotSetAsync(Instant time)
      Specified by:
      expireIfNotSetAsync in interface RExpirableAsync
    • expireIfGreater

      public boolean expireIfGreater(Instant time)
      Description copied from interface: RExpirable
      Sets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.

      Requires Redis 7.0.0 and higher.

      Specified by:
      expireIfGreater in interface RExpirable
      Parameters:
      time - expire date
      Returns:
      true if the timeout was set and false if not
    • expireIfGreaterAsync

      public RFuture<Boolean> expireIfGreaterAsync(Instant time)
      Specified by:
      expireIfGreaterAsync in interface RExpirableAsync
    • expireIfLess

      public boolean expireIfLess(Instant time)
      Description copied from interface: RExpirable
      Sets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.

      Requires Redis 7.0.0 and higher.

      Specified by:
      expireIfLess in interface RExpirable
      Parameters:
      time - expire date
      Returns:
      true if the timeout was set and false if not
    • expireIfLessAsync

      public RFuture<Boolean> expireIfLessAsync(Instant time)
      Specified by:
      expireIfLessAsync in interface RExpirableAsync
    • 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
    • expire

      public boolean expire(Duration duration)
      Description copied from interface: RExpirable
      Sets a timeout for this object. After the timeout has expired, the key will automatically be deleted.
      Specified by:
      expire in interface RExpirable
      Parameters:
      duration - timeout before object will be deleted
      Returns:
      true if the timeout was set and false if not
    • expireAsync

      public RFuture<Boolean> expireAsync(Duration duration)
      Description copied from interface: RExpirableAsync
      Set a timeout for object. After the timeout has expired, the key will automatically be deleted.
      Specified by:
      expireAsync in interface RExpirableAsync
      Parameters:
      duration - timeout before object will be deleted
      Returns:
      true if the timeout was set and false if not
    • expireAt

      public boolean expireAt(Date timestamp)
      Description copied from interface: RExpirable
      Specified by:
      expireAt in interface RExpirable
      Parameters:
      timestamp - - expire date
      Returns:
      true if the timeout was set and false if not
    • expireAtAsync

      public RFuture<Boolean> expireAtAsync(Date timestamp)
      Description copied from interface: RExpirableAsync
      Specified by:
      expireAtAsync in interface RExpirableAsync
      Parameters:
      timestamp - - expire date
      Returns:
      true if the timeout was set and false if not
    • expireIfSet

      public boolean expireIfSet(Duration duration)
      Description copied from interface: RExpirable
      Sets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.

      Requires Redis 7.0.0 and higher.

      Specified by:
      expireIfSet in interface RExpirable
      Parameters:
      duration - timeout before object will be deleted
      Returns:
      true if the timeout was set and false if not
    • expireIfSetAsync

      public RFuture<Boolean> expireIfSetAsync(Duration duration)
      Specified by:
      expireIfSetAsync in interface RExpirableAsync
    • expireIfNotSet

      public boolean expireIfNotSet(Duration duration)
      Description copied from interface: RExpirable
      Sets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.

      Requires Redis 7.0.0 and higher.

      Specified by:
      expireIfNotSet in interface RExpirable
      Parameters:
      duration - timeout before object will be deleted
      Returns:
      true if the timeout was set and false if not
    • expireIfNotSetAsync

      public RFuture<Boolean> expireIfNotSetAsync(Duration duration)
      Specified by:
      expireIfNotSetAsync in interface RExpirableAsync
    • expireIfGreater

      public boolean expireIfGreater(Duration duration)
      Description copied from interface: RExpirable
      Sets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.

      Requires Redis 7.0.0 and higher.

      Specified by:
      expireIfGreater in interface RExpirable
      Parameters:
      duration - timeout before object will be deleted
      Returns:
      true if the timeout was set and false if not
    • expireIfGreaterAsync

      public RFuture<Boolean> expireIfGreaterAsync(Duration duration)
      Specified by:
      expireIfGreaterAsync in interface RExpirableAsync
    • expireIfLess

      public boolean expireIfLess(Duration duration)
      Description copied from interface: RExpirable
      Sets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.

      Requires Redis 7.0.0 and higher.

      Specified by:
      expireIfLess in interface RExpirable
      Parameters:
      duration - timeout before object will be deleted
      Returns:
      true if the timeout was set and false if not
    • expireIfLessAsync

      public RFuture<Boolean> expireIfLessAsync(Duration duration)
      Specified by:
      expireIfLessAsync in interface RExpirableAsync
    • 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.
    • getExpireTime

      public long getExpireTime()
      Description copied from interface: RExpirable
      Expiration time of Redisson object that has a timeout

      Requires Redis 7.0.0 and higher.

      Specified by:
      getExpireTime in interface RExpirable
      Returns:
      expiration time
    • getExpireTimeAsync

      public RFuture<Long> getExpireTimeAsync()
      Description copied from interface: RExpirableAsync
      Expiration time of Redisson object that has a timeout

      Requires Redis 7.0.0 and higher.

      Specified by:
      getExpireTimeAsync in interface RExpirableAsync
      Returns:
      expiration time
    • expireAsync

      protected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String param, String... keys)
    • expireAtAsync

      protected RFuture<Boolean> expireAtAsync(long timestamp, String param, String... keys)
    • clearExpireAsync

      protected RFuture<Boolean> clearExpireAsync(String... keys)