Package org.redisson
Class RedissonLexSortedSet
- java.lang.Object
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonScoredSortedSet<String>
-
- org.redisson.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.redisson.api.RScoredSortedSet
RScoredSortedSet.Aggregate
-
-
Field Summary
-
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
-
Constructor Summary
Constructors Constructor Description RedissonLexSortedSet(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(String e)
boolean
addAll(Collection<? extends String> c)
RFuture<Boolean>
addAllAsync(Collection<? extends String> c)
Adds all elements contained in the specified collectionRFuture<Boolean>
addAsync(String e)
Adds element into this collection.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)
Comparator<? super String>
comparator()
int
count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Returns the number of elements betweenfromElement
andtoElement
.RFuture<Integer>
countAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Returns the number of elements betweenfromElement
andtoElement
.int
countHead(String toElement, boolean toInclusive)
Returns the number of head values ending withtoElement
.RFuture<Integer>
countHeadAsync(String toElement, boolean toInclusive)
Returns the number of head values ending withtoElement
.int
countTail(String fromElement, boolean fromInclusive)
Returns the number of tail values starting withfromElement
.RFuture<Integer>
countTailAsync(String fromElement, boolean fromInclusive)
Returns the number of tail values starting withfromElement
.Iterator<String>
distributedIterator(String iteratorName, int count)
Returns iterator over elements that match specified pattern.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)
insteadSortedSet<String>
headSet(String toElement)
Collection<String>
range(int startIndex, int endIndex)
Returns values by rank range.Collection<String>
range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Returns values range starting withfromElement
and ending withtoElement
.Collection<String>
range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
Returns values range starting withfromElement
and ending withtoElement
.RFuture<Collection<String>>
rangeAsync(int startIndex, int endIndex)
Returns values by rank range.RFuture<Collection<String>>
rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Returns values range starting withfromElement
and ending withtoElement
.RFuture<Collection<String>>
rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
Returns values range starting withfromElement
and ending withtoElement
.Collection<String>
rangeHead(String toElement, boolean toInclusive)
Returns head values range ending withtoElement
.Collection<String>
rangeHead(String toElement, boolean toInclusive, int offset, int count)
Returns head values range ending withtoElement
.RFuture<Collection<String>>
rangeHeadAsync(String toElement, boolean toInclusive)
Returns head values range ending withtoElement
.RFuture<Collection<String>>
rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count)
Returns head values range ending withtoElement
.Collection<String>
rangeHeadReversed(String toElement, boolean toInclusive)
Returns head values range in reverse order ending withtoElement
.Collection<String>
rangeHeadReversed(String toElement, boolean toInclusive, int offset, int count)
Returns head values range in reverse order ending withtoElement
.RFuture<Collection<String>>
rangeHeadReversedAsync(String toElement, boolean toInclusive)
Returns head values range in reverse order ending withtoElement
.RFuture<Collection<String>>
rangeHeadReversedAsync(String toElement, boolean toInclusive, int offset, int count)
Returns head values range in reverse order ending withtoElement
.Collection<String>
rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Returns values range in reverse order starting withfromElement
and ending withtoElement
.Collection<String>
rangeReversed(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
Returns values range in reverse order starting withfromElement
and ending withtoElement
.RFuture<Collection<String>>
rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Returns values range in reverse order starting withfromElement
and ending withtoElement
.RFuture<Collection<String>>
rangeReversedAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count)
Returns values range in reverse order starting withfromElement
and ending withtoElement
.Collection<String>
rangeTail(String fromElement, boolean fromInclusive)
Returns tail values range starting withfromElement
.Collection<String>
rangeTail(String fromElement, boolean fromInclusive, int offset, int count)
Returns tail values range starting withfromElement
.RFuture<Collection<String>>
rangeTailAsync(String fromElement, boolean fromInclusive)
Returns tail values range starting withfromElement
.RFuture<Collection<String>>
rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count)
Returns tail values range starting withfromElement
.Collection<String>
rangeTailReversed(String fromElement, boolean fromInclusive)
Returns tail values range in reverse order starting withfromElement
.Collection<String>
rangeTailReversed(String fromElement, boolean fromInclusive, int offset, int count)
Returns tail values range in reverse order starting withfromElement
.RFuture<Collection<String>>
rangeTailReversedAsync(String fromElement, boolean fromInclusive)
Returns tail values range in reverse order starting withfromElement
.RFuture<Collection<String>>
rangeTailReversedAsync(String fromElement, boolean fromInclusive, int offset, int count)
Returns tail values range in reverse order starting withfromElement
.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 timeoutint
removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Removes values range starting withfromElement
and ending withtoElement
.RFuture<Integer>
removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Removes values range starting withfromElement
and ending withtoElement
.int
removeRangeHead(String toElement, boolean toInclusive)
Removes head values range ending withtoElement
.RFuture<Integer>
removeRangeHeadAsync(String toElement, boolean toInclusive)
Removes head values range ending withtoElement
.int
removeRangeTail(String fromElement, boolean fromInclusive)
Removes tail values range starting withfromElement
.RFuture<Integer>
removeRangeTailAsync(String fromElement, boolean fromInclusive)
Removes tail values range starting withfromElement
.SortedSet<String>
subSet(String fromElement, String toElement)
SortedSet<String>
tailSet(String fromElement)
boolean
trySetComparator(Comparator<? super String> comparator)
Sets new comparator only if current set is empty-
Methods inherited from class org.redisson.RedissonScoredSortedSet
add, addAll, addAllAsync, addAndGetRank, addAndGetRankAsync, addAndGetRevRank, addAndGetRevRank, addAndGetRevRankAsync, addAndGetRevRankAsync, addAsync, addIfExists, addIfExistsAsync, addIfGreater, addIfGreaterAsync, addIfLess, addIfLessAsync, addListener, addListenerAsync, addScore, addScoreAndGetRank, addScoreAndGetRankAsync, addScoreAndGetRevRank, addScoreAndGetRevRankAsync, addScoreAsync, clear, contains, containsAll, containsAllAsync, containsAsync, count, countAsync, countIntersection, countIntersection, countIntersectionAsync, countIntersectionAsync, diff, diffAsync, distributedIterator, distributedIterator, distributedIterator, entryRange, entryRange, entryRange, entryRangeAsync, entryRangeAsync, entryRangeAsync, entryRangeReversed, entryRangeReversed, entryRangeReversed, entryRangeReversedAsync, entryRangeReversedAsync, entryRangeReversedAsync, first, firstAsync, firstScore, firstScoreAsync, getScore, getScore, getScoreAsync, getScoreAsync, intersection, intersection, intersection, intersection, intersectionAsync, intersectionAsync, intersectionAsync, intersectionAsync, isEmpty, iterator, iterator, iterator, iterator, last, lastAsync, lastScore, lastScoreAsync, mapReduce, pollFirst, pollFirst, pollFirst, pollFirstAsync, pollFirstAsync, pollFirstAsync, pollFirstFromAny, pollFirstFromAnyAsync, pollLast, pollLast, pollLast, pollLastAsync, pollLastAsync, pollLastAsync, pollLastFromAny, pollLastFromAnyAsync, random, random, randomAsync, randomAsync, randomEntries, randomEntriesAsync, rangeTo, rangeTo, rangeTo, rangeToAsync, rangeToAsync, rangeToAsync, rank, rankAsync, readAll, readAllAsync, readDiff, readDiffAsync, readIntersection, readIntersection, readIntersection, readIntersection, readIntersectionAsync, readIntersectionAsync, readIntersectionAsync, readIntersectionAsync, readSort, readSort, readSort, readSort, readSort, readSort, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readUnion, readUnion, readUnion, readUnion, readUnionAsync, readUnionAsync, readUnionAsync, readUnionAsync, remove, removeAll, removeAllAsync, removeAsync, removeListener, removeListenerAsync, removeRangeByRank, removeRangeByRankAsync, removeRangeByScore, removeRangeByScoreAsync, retainAll, retainAllAsync, revRangeTo, revRangeTo, revRangeTo, revRangeToAsync, revRangeToAsync, revRangeToAsync, revRank, revRank, revRankAsync, revRankAsync, scanIteratorAsync, size, sizeAsync, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, stream, stream, stream, stream, subscribeOnFirstElements, subscribeOnLastElements, takeFirst, takeFirstAsync, takeLast, takeLastAsync, toArray, toArray, tryAdd, tryAddAsync, union, union, union, union, unionAsync, unionAsync, unionAsync, unionAsync, unsubscribe, valueRange, valueRange, valueRange, valueRangeAsync, valueRangeAsync, valueRangeAsync, valueRangeReversed, valueRangeReversed, valueRangeReversed, valueRangeReversedAsync, valueRangeReversedAsync, valueRangeReversedAsync
-
Methods inherited from class org.redisson.RedissonObject
addListener, 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, 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, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.redisson.api.RCollectionAsync
containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
-
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.RLexSortedSet
pollFirst, pollLast, rank, revRank
-
Methods inherited from interface org.redisson.api.RLexSortedSetAsync
firstAsync, lastAsync, pollFirstAsync, pollLastAsync, rankAsync, readAllAsync, revRankAsync
-
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
-
Methods inherited from interface org.redisson.api.RSortedSet
distributedIterator, mapReduce, readAll, readAllAsync, removeAsync
-
Methods inherited from interface java.util.Set
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from interface java.util.SortedSet
first, last, spliterator
-
-
-
-
Constructor Detail
-
RedissonLexSortedSet
public RedissonLexSortedSet(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
-
Method Detail
-
removeRange
public int removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
Description copied from interface:RLexSortedSet
Removes values range starting withfromElement
and ending withtoElement
.- Specified by:
removeRange
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - 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 withtoElement
.- Specified by:
removeRangeHead
in interfaceRLexSortedSet
- Parameters:
toElement
- - end elementtoInclusive
- - 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 withtoElement
.- Specified by:
removeRangeHeadAsync
in interfaceRLexSortedSetAsync
- Parameters:
toElement
- - end elementtoInclusive
- - 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 withfromElement
.- Specified by:
removeRangeTail
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - 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 withfromElement
.- Specified by:
removeRangeTailAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - 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 withfromElement
and ending withtoElement
.- Specified by:
removeRangeAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - 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 withfromElement
and ending withtoElement
.- Specified by:
range
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - 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 withtoElement
.- Specified by:
rangeHead
in interfaceRLexSortedSet
- Parameters:
toElement
- - end elementtoInclusive
- - 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 withtoElement
.- Specified by:
rangeHeadAsync
in interfaceRLexSortedSetAsync
- Parameters:
toElement
- - end elementtoInclusive
- - 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 withfromElement
.- Specified by:
rangeTail
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - 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 withfromElement
.- Specified by:
rangeTailAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - 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 withfromElement
and ending withtoElement
.- Specified by:
rangeAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - 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 withfromElement
and ending withtoElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
range
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - 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 withtoElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeHead
in interfaceRLexSortedSet
- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - 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 withtoElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeHeadAsync
in interfaceRLexSortedSetAsync
- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - 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 withfromElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeTail
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusiveoffset
- - offset of result collectioncount
- - 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 withfromElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeTailAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusiveoffset
- - offset of result collectioncount
- - 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 withfromElement
and ending withtoElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - 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 withfromElement
.- Specified by:
rangeTailReversed
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - 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 withtoElement
.- Specified by:
rangeHeadReversed
in interfaceRLexSortedSet
- Parameters:
toElement
- - end elementtoInclusive
- - 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 withfromElement
and ending withtoElement
.- Specified by:
rangeReversed
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - 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 withfromElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeTailReversed
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusiveoffset
- - offset of result collectioncount
- - 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 withtoElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeHeadReversed
in interfaceRLexSortedSet
- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - 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 withfromElement
and ending withtoElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeReversed
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - 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 withfromElement
.- Specified by:
rangeTailReversedAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - 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 withtoElement
.- Specified by:
rangeHeadReversedAsync
in interfaceRLexSortedSetAsync
- Parameters:
toElement
- - end elementtoInclusive
- - 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 withfromElement
and ending withtoElement
.- Specified by:
rangeReversedAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - 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 withfromElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeTailReversedAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusiveoffset
- - offset of result collectioncount
- - 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 withtoElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeHeadReversedAsync
in interfaceRLexSortedSetAsync
- Parameters:
toElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - 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 withfromElement
and ending withtoElement
. Returned collection limited bycount
and starts withoffset
.- Specified by:
rangeReversedAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - end element inclusiveoffset
- - offset of result collectioncount
- - 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 withfromElement
.- Specified by:
countTail
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - 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 withfromElement
.- Specified by:
countTailAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - 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 withtoElement
.- Specified by:
countHead
in interfaceRLexSortedSet
- Parameters:
toElement
- - end elementtoInclusive
- - 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 withtoElement
.- Specified by:
countHeadAsync
in interfaceRLexSortedSetAsync
- Parameters:
toElement
- - end elementtoInclusive
- - 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 betweenfromElement
andtoElement
.- Specified by:
count
in interfaceRLexSortedSet
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - 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 betweenfromElement
andtoElement
.- Specified by:
countAsync
in interfaceRLexSortedSetAsync
- Parameters:
fromElement
- - start elementfromInclusive
- - start element inclusivetoElement
- - end elementtoInclusive
- - 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 interfaceRCollectionAsync<String>
- Specified by:
addAsync
in interfaceRSortedSet<String>
- Parameters:
e
- - element to add- Returns:
true
if an element was added andfalse
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 interfaceRCollectionAsync<String>
- Parameters:
c
- - collection of elements to add- Returns:
true
if at least one element was added andfalse
if all elements are already present
-
add
public boolean add(String e)
-
addAll
public boolean addAll(Collection<? extends String> c)
-
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 interfaceRLexSortedSet
- Parameters:
startIndex
- - start indexendIndex
- - 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 interfaceRLexSortedSetAsync
- Parameters:
startIndex
- - start indexendIndex
- - 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 interfaceRSortedSet<String>
- Parameters:
comparator
- for values- Returns:
true
if new comparator settedfalse
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 interfaceRSortedSet<String>
- Parameters:
iteratorName
- redis object name to which cursor will be savedcount
- batch size- Returns:
- shared elements iterator
-
comparator
public Comparator<? super String> comparator()
- Specified by:
comparator
in interfaceSortedSet<String>
-
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)
-
-