Package org.redisson
Class RedissonList<V>
- java.lang.Object
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonList<V>
-
- Type Parameters:
V- the type of elements held in this collection
- All Implemented Interfaces:
Iterable<V>,Collection<V>,List<V>,RandomAccess,RCollectionAsync<V>,RExpirable,RExpirableAsync,RList<V>,RListAsync<V>,RObject,RObjectAsync,RSortable<List<V>>,RSortableAsync<List<V>>
- Direct Known Subclasses:
RedissonPriorityQueue,RedissonQueue,RedissonSubList
public class RedissonList<V> extends RedissonObject implements RList<V>
Distributed and concurrent implementation ofList- Author:
- Nikita Koksharov
-
-
Field Summary
-
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
-
Constructor Summary
Constructors Constructor Description RedissonList(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)RedissonList(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, V element)booleanadd(V e)intaddAfter(V elementToFind, V element)AddelementafterelementToFindRFuture<Integer>addAfterAsync(V elementToFind, V element)InsertselementafterelementToFindbooleanaddAll(int index, Collection<? extends V> coll)booleanaddAll(Collection<? extends V> c)RFuture<Boolean>addAllAsync(int index, Collection<? extends V> coll)Insertselementsatindex.RFuture<Boolean>addAllAsync(Collection<? extends V> c)Adds all elements contained in the specified collectionRFuture<Boolean>addAsync(int index, V element)Insertselementatindex.RFuture<Boolean>addAsync(V e)Adds element into this collection.protected <T> RFuture<T>addAsync(V e, RedisCommand<T> command)intaddBefore(V elementToFind, V element)AddelementbeforeelementToFindRFuture<Integer>addBeforeAsync(V elementToFind, V element)InsertselementbeforeelementToFindintaddListener(ObjectListener listener)Adds object event listenerRFuture<Integer>addListenerAsync(ObjectListener listener)Adds object event listenervoidclear()booleanclearExpire()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)booleancontains(Object o)booleancontainsAll(Collection<?> c)RFuture<Boolean>containsAllAsync(Collection<?> c)Returnstrueif this collection contains all of the elements in the specified collection.RFuture<Boolean>containsAsync(Object o)Returnstrueif this collection contains encoded state of the specified element.booleanequals(Object o)booleanexpire(long timeToLive, TimeUnit timeUnit)Set a timeout for object.booleanexpire(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.booleanexpireAt(long timestamp)UseRExpirable.expire(Instant)insteadbooleanexpireAt(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)insteadvoidfastRemove(int index)Remove object by specified indexRFuture<Void>fastRemoveAsync(int index)Removes element atindex.voidfastSet(int index, V element)Setelementatindex.RFuture<Void>fastSetAsync(int index, V element)Setelementatindex.Vget(int index)List<V>get(int... indexes)Loads elements by specifiedindexesRFuture<V>getAsync(int index)Get element atindexRFuture<List<V>>getAsync(int... indexes)Loads elements by specifiedindexesinthashCode()intindexOf(Object o)RFuture<Integer>indexOfAsync(Object o)Returns last index ofelementor -1 if element isn't found<R> RFuture<R>indexOfAsync(Object o, Convertor<R> convertor)booleanisEmpty()Iterator<V>iterator()intlastIndexOf(Object o)RFuture<Integer>lastIndexOfAsync(Object o)Returns last index ofelementor -1 if element isn't found<R> RFuture<R>lastIndexOfAsync(Object o, Convertor<R> convertor)ListIterator<V>listIterator()ListIterator<V>listIterator(int ind)<KOut,VOut>
RCollectionMapReduce<V,KOut,VOut>mapReduce()ReturnsRMapReduceobject associated with this mapList<V>range(int toIndex)Returns range of values from 0 index totoIndex.List<V>range(int fromIndex, int toIndex)Returns range of values fromfromIndextotoIndexindex including.RFuture<List<V>>rangeAsync(int toIndex)Returns range of values from 0 index totoIndex.RFuture<List<V>>rangeAsync(int fromIndex, int toIndex)Returns range of values fromfromIndextotoIndexindex including.List<V>readAll()Read all elements at onceRFuture<List<V>>readAllAsync()Read all elements at once<T> Collection<T>readSort(String byPattern, List<String> getPatterns, SortOrder order)Read data in sorted view<T> Collection<T>readSort(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)Read data in sorted viewList<V>readSort(String byPattern, SortOrder order)Read data in sorted viewList<V>readSort(String byPattern, SortOrder order, int offset, int count)Read data in sorted viewList<V>readSort(SortOrder order)Read data in sorted viewList<V>readSort(SortOrder order, int offset, int count)Read data in sorted view<T> Collection<T>readSortAlpha(String byPattern, List<String> getPatterns, SortOrder order)Read data in sorted view lexicographically<T> Collection<T>readSortAlpha(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)Read data in sorted view lexicographicallyList<V>readSortAlpha(String byPattern, SortOrder order)Read data in sorted view lexicographicallyList<V>readSortAlpha(String byPattern, SortOrder order, int offset, int count)Read data in sorted view lexicographicallyList<V>readSortAlpha(SortOrder order)Read data in sorted view lexicographicallyList<V>readSortAlpha(SortOrder order, int offset, int count)Read data in sorted view lexicographically<T> RFuture<Collection<T>>readSortAlphaAsync(String byPattern, List<String> getPatterns, SortOrder order)Read data in sorted view lexicographically<T> RFuture<Collection<T>>readSortAlphaAsync(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)Read data in sorted view lexicographicallyRFuture<List<V>>readSortAlphaAsync(String byPattern, SortOrder order)Read data in sorted view lexicographicallyRFuture<List<V>>readSortAlphaAsync(String byPattern, SortOrder order, int offset, int count)Read data in sorted view lexicographicallyRFuture<List<V>>readSortAlphaAsync(SortOrder order)Read data in sorted view lexicographicallyRFuture<List<V>>readSortAlphaAsync(SortOrder order, int offset, int count)Read data in sorted view lexicographically<T> RFuture<Collection<T>>readSortAsync(String byPattern, List<String> getPatterns, SortOrder order)Read data in sorted view<T> RFuture<Collection<T>>readSortAsync(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)Read data in sorted viewRFuture<List<V>>readSortAsync(String byPattern, SortOrder order)Read data in sorted viewRFuture<List<V>>readSortAsync(String byPattern, SortOrder order, int offset, int count)Read data in sorted viewRFuture<List<V>>readSortAsync(SortOrder order)Read data in sorted viewRFuture<List<V>>readSortAsync(SortOrder order, int offset, int count)Read data in sorted viewlongremainTimeToLive()Remaining time to live of Redisson object that has a timeoutRFuture<Long>remainTimeToLiveAsync()Remaining time to live of Redisson object that has a timeoutVremove(int index)booleanremove(Object o)booleanremove(Object o, int count)Removes up tocountoccurrences ofelementbooleanremoveAll(Collection<?> c)RFuture<Boolean>removeAllAsync(Collection<?> c)Removes all of this collection's elements that are also contained in the specified collection.RFuture<V>removeAsync(int index)Removes element atindex.RFuture<Boolean>removeAsync(Object o)Removes a single instance of the specified element from this collection, if it is present.RFuture<Boolean>removeAsync(Object o, int count)Removes up tocountoccurrences ofelementbooleanremoveIf(Predicate<? super V> filter)voidremoveListener(int listenerId)Removes object event listenerRFuture<Void>removeListenerAsync(int listenerId)Removes object event listenerbooleanretainAll(Collection<?> c)RFuture<Boolean>retainAllAsync(Collection<?> c)Retains only the elements in this collection that are contained in the specified collection.Vset(int index, V element)RFuture<V>setAsync(int index, V element)Setelementatindexand returns previous element.intsize()RFuture<Integer>sizeAsync()Returns number of elements in this collection.intsortTo(String destName, String byPattern, List<String> getPatterns, SortOrder order)Sort data and store todestNamelistintsortTo(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)Sort data and store todestNamelistintsortTo(String destName, String byPattern, SortOrder order)Sort data and store todestNamelistintsortTo(String destName, String byPattern, SortOrder order, int offset, int count)Sort data and store todestNamelistintsortTo(String destName, SortOrder order)Sort data and store todestNamelistintsortTo(String destName, SortOrder order, int offset, int count)Sort data and store todestNamelistRFuture<Integer>sortToAsync(String destName, String byPattern, List<String> getPatterns, SortOrder order)Sort data and store todestNamelistRFuture<Integer>sortToAsync(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)Sort data and store todestNamelistRFuture<Integer>sortToAsync(String destName, String byPattern, SortOrder order)Sort data and store todestNamelistRFuture<Integer>sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count)Sort data and store todestNamelistRFuture<Integer>sortToAsync(String destName, SortOrder order)Sort data and store todestNamelistRFuture<Integer>sortToAsync(String destName, SortOrder order, int offset, int count)Sort data and store todestNamelistRList<V>subList(int fromIndex, int toIndex)Object[]toArray()<T> T[]toArray(T[] a)StringtoString()voidtrim(int fromIndex, int toIndex)Trim list and remains elements only in specified rangefromIndex, inclusive, andtoIndex, inclusive.RFuture<Void>trimAsync(int fromIndex, int toIndex)Trim list and remains elements only in specified rangefromIndex, inclusive, andtoIndex, inclusive.-
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, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
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.RObject
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
-
-
-
Constructor Detail
-
RedissonList
public RedissonList(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
RedissonList
public RedissonList(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
-
Method Detail
-
mapReduce
public <KOut,VOut> RCollectionMapReduce<V,KOut,VOut> mapReduce()
Description copied from interface:RListReturnsRMapReduceobject associated with this map
-
size
public int size()
-
sizeAsync
public RFuture<Integer> sizeAsync()
Description copied from interface:RCollectionAsyncReturns number of elements in this collection.- Specified by:
sizeAsyncin interfaceRCollectionAsync<V>- Returns:
- size of collection
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
toArray
public Object[] toArray()
-
readAllAsync
public RFuture<List<V>> readAllAsync()
Description copied from interface:RListAsyncRead all elements at once- Specified by:
readAllAsyncin interfaceRListAsync<V>- Returns:
- list of values
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(V e)
-
addAsync
public RFuture<Boolean> addAsync(V e)
Description copied from interface:RCollectionAsyncAdds element into this collection.- Specified by:
addAsyncin interfaceRCollectionAsync<V>- Parameters:
e- - element to add- Returns:
trueif an element was added andfalseif it is already present
-
addAsync
protected <T> RFuture<T> addAsync(V e, RedisCommand<T> command)
-
remove
public boolean remove(Object o)
-
removeAsync
public RFuture<Boolean> removeAsync(Object o)
Description copied from interface:RCollectionAsyncRemoves a single instance of the specified element from this collection, if it is present.- Specified by:
removeAsyncin interfaceRCollectionAsync<V>- Parameters:
o- element to be removed from this collection, if present- Returns:
trueif an element was removed as a result of this call
-
removeAsync
public RFuture<Boolean> removeAsync(Object o, int count)
Description copied from interface:RListAsyncRemoves up tocountoccurrences ofelement- Specified by:
removeAsyncin interfaceRListAsync<V>- Parameters:
o- - element to findcount- - amount occurrences- Returns:
trueif at least one element removed; orfalseif element isn't found
-
remove
public boolean remove(Object o, int count)
Description copied from interface:RListRemoves up tocountoccurrences ofelement
-
containsAllAsync
public RFuture<Boolean> containsAllAsync(Collection<?> c)
Description copied from interface:RCollectionAsyncReturnstrueif this collection contains all of the elements in the specified collection.- Specified by:
containsAllAsyncin interfaceRCollectionAsync<V>- Parameters:
c- collection to be checked for containment in this collection- Returns:
trueif this collection contains all of the elements in the specified collection
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<V>- Specified by:
containsAllin interfaceList<V>
-
addAll
public boolean addAll(Collection<? extends V> c)
-
addAllAsync
public RFuture<Boolean> addAllAsync(Collection<? extends V> c)
Description copied from interface:RCollectionAsyncAdds all elements contained in the specified collection- Specified by:
addAllAsyncin interfaceRCollectionAsync<V>- Parameters:
c- - collection of elements to add- Returns:
trueif at least one element was added andfalseif all elements are already present
-
addAllAsync
public RFuture<Boolean> addAllAsync(int index, Collection<? extends V> coll)
Description copied from interface:RListAsyncInsertselementsatindex. Subsequent elements are shifted.- Specified by:
addAllAsyncin interfaceRListAsync<V>- Parameters:
index- - index numbercoll- - elements to insert- Returns:
trueif list changed orfalseif element isn't found
-
addAll
public boolean addAll(int index, Collection<? extends V> coll)
-
removeAllAsync
public RFuture<Boolean> removeAllAsync(Collection<?> c)
Description copied from interface:RCollectionAsyncRemoves all of this collection's elements that are also contained in the specified collection.- Specified by:
removeAllAsyncin interfaceRCollectionAsync<V>- Parameters:
c- collection containing elements to be removed from this collection- Returns:
trueif this collection changed as a result of the call
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
retainAllAsync
public RFuture<Boolean> retainAllAsync(Collection<?> c)
Description copied from interface:RCollectionAsyncRetains only the elements in this collection that are contained in the specified collection.- Specified by:
retainAllAsyncin interfaceRCollectionAsync<V>- Parameters:
c- collection containing elements to be retained in this collection- Returns:
trueif this collection changed as a result of the call
-
clear
public void clear()
-
getAsync
public RFuture<V> getAsync(int index)
Description copied from interface:RListAsyncGet element atindex- Specified by:
getAsyncin interfaceRListAsync<V>- Parameters:
index- - index of object- Returns:
- element
-
get
public List<V> get(int... indexes)
Description copied from interface:RListLoads elements by specifiedindexes
-
getAsync
public RFuture<List<V>> getAsync(int... indexes)
Description copied from interface:RListAsyncLoads elements by specifiedindexes- Specified by:
getAsyncin interfaceRListAsync<V>- Parameters:
indexes- of elements- Returns:
- elements
-
setAsync
public RFuture<V> setAsync(int index, V element)
Description copied from interface:RListAsyncSetelementatindexand returns previous element.- Specified by:
setAsyncin interfaceRListAsync<V>- Parameters:
index- - index of objectelement- - object- Returns:
- previous element or
nullif element wasn't set.
-
fastSetAsync
public RFuture<Void> fastSetAsync(int index, V element)
Description copied from interface:RListAsyncSetelementatindex. Works faster thanRListAsync.setAsync(int, Object)but doesn't return previous element.- Specified by:
fastSetAsyncin interfaceRListAsync<V>- Parameters:
index- - index of objectelement- - object- Returns:
- void
-
addAsync
public RFuture<Boolean> addAsync(int index, V element)
Description copied from interface:RListAsyncInsertselementatindex. Subsequent elements are shifted.- Specified by:
addAsyncin interfaceRListAsync<V>- Parameters:
index- - index numberelement- - element to insert- Returns:
trueif list was changed
-
removeAsync
public RFuture<V> removeAsync(int index)
Description copied from interface:RListAsyncRemoves element atindex.- Specified by:
removeAsyncin interfaceRListAsync<V>- Parameters:
index- - index of object- Returns:
- element or
nullif element wasn't set.
-
fastRemove
public void fastRemove(int index)
Description copied from interface:RListRemove object by specified index- Specified by:
fastRemovein interfaceRList<V>- Parameters:
index- - index of object
-
fastRemoveAsync
public RFuture<Void> fastRemoveAsync(int index)
Description copied from interface:RListAsyncRemoves element atindex. Works faster thanRListAsync.removeAsync(Object, int)but doesn't return element.- Specified by:
fastRemoveAsyncin interfaceRListAsync<V>- Parameters:
index- - index of object- Returns:
- void
-
containsAsync
public RFuture<Boolean> containsAsync(Object o)
Description copied from interface:RCollectionAsyncReturnstrueif this collection contains encoded state of the specified element.- Specified by:
containsAsyncin interfaceRCollectionAsync<V>- Parameters:
o- element whose presence in this collection is to be tested- Returns:
trueif this collection contains the specified element andfalseotherwise
-
indexOfAsync
public RFuture<Integer> indexOfAsync(Object o)
Description copied from interface:RListAsyncReturns last index ofelementor -1 if element isn't found- Specified by:
indexOfAsyncin interfaceRListAsync<V>- Parameters:
o- to find- Returns:
- index of -1 if element isn't found
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<V>
-
lastIndexOfAsync
public RFuture<Integer> lastIndexOfAsync(Object o)
Description copied from interface:RListAsyncReturns last index ofelementor -1 if element isn't found- Specified by:
lastIndexOfAsyncin interfaceRListAsync<V>- Parameters:
o- to find- Returns:
- index of -1 if element isn't found
-
trim
public void trim(int fromIndex, int toIndex)Description copied from interface:RListTrim list and remains elements only in specified rangefromIndex, inclusive, andtoIndex, inclusive.
-
trimAsync
public RFuture<Void> trimAsync(int fromIndex, int toIndex)
Description copied from interface:RListAsyncTrim list and remains elements only in specified rangefromIndex, inclusive, andtoIndex, inclusive.- Specified by:
trimAsyncin interfaceRListAsync<V>- Parameters:
fromIndex- - from indextoIndex- - to index- Returns:
- void
-
listIterator
public ListIterator<V> listIterator()
- Specified by:
listIteratorin interfaceList<V>
-
listIterator
public ListIterator<V> listIterator(int ind)
- Specified by:
listIteratorin interfaceList<V>
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
addAfterAsync
public RFuture<Integer> addAfterAsync(V elementToFind, V element)
Description copied from interface:RListAsyncInsertselementafterelementToFind- Specified by:
addAfterAsyncin interfaceRListAsync<V>- Parameters:
elementToFind- - object to findelement- - object to add- Returns:
- new list size
-
addBeforeAsync
public RFuture<Integer> addBeforeAsync(V elementToFind, V element)
Description copied from interface:RListAsyncInsertselementbeforeelementToFind- Specified by:
addBeforeAsyncin interfaceRListAsync<V>- Parameters:
elementToFind- - object to findelement- - object to add- Returns:
- new list size
-
addAfter
public int addAfter(V elementToFind, V element)
Description copied from interface:RListAddelementafterelementToFind
-
addBefore
public int addBefore(V elementToFind, V element)
Description copied from interface:RListAddelementbeforeelementToFind
-
readSort
public List<V> readSort(SortOrder order)
Description copied from interface:RSortableRead data in sorted view
-
readSortAsync
public RFuture<List<V>> readSortAsync(SortOrder order)
Description copied from interface:RSortableAsyncRead data in sorted view- Specified by:
readSortAsyncin interfaceRSortableAsync<V>- Parameters:
order- for sorted data- Returns:
- sorted collection
-
readSort
public List<V> readSort(SortOrder order, int offset, int count)
Description copied from interface:RSortableRead data in sorted view
-
readSortAsync
public RFuture<List<V>> readSortAsync(SortOrder order, int offset, int count)
Description copied from interface:RSortableAsyncRead data in sorted view- Specified by:
readSortAsyncin interfaceRSortableAsync<V>- Parameters:
order- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection
-
readSort
public List<V> readSort(String byPattern, SortOrder order)
Description copied from interface:RSortableRead data in sorted view
-
readSortAsync
public RFuture<List<V>> readSortAsync(String byPattern, SortOrder order)
Description copied from interface:RSortableAsyncRead data in sorted view- Specified by:
readSortAsyncin interfaceRSortableAsync<V>- Parameters:
byPattern- that is used to generate the keys that are used for sortingorder- for sorted data- Returns:
- sorted collection
-
readSort
public List<V> readSort(String byPattern, SortOrder order, int offset, int count)
Description copied from interface:RSortableRead data in sorted view
-
readSortAsync
public RFuture<List<V>> readSortAsync(String byPattern, SortOrder order, int offset, int count)
Description copied from interface:RSortableAsyncRead data in sorted view- Specified by:
readSortAsyncin interfaceRSortableAsync<V>- Parameters:
byPattern- that is used to generate the keys that are used for sortingorder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection
-
readSort
public <T> Collection<T> readSort(String byPattern, List<String> getPatterns, SortOrder order)
Description copied from interface:RSortableRead data in sorted view
-
readSortAsync
public <T> RFuture<Collection<T>> readSortAsync(String byPattern, List<String> getPatterns, SortOrder order)
Description copied from interface:RSortableAsyncRead data in sorted view- Specified by:
readSortAsyncin interfaceRSortableAsync<V>- Type Parameters:
T- object type- Parameters:
byPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted data- Returns:
- sorted collection
-
readSort
public <T> Collection<T> readSort(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)
Description copied from interface:RSortableRead data in sorted view- Specified by:
readSortin interfaceRSortable<V>- Type Parameters:
T- object type- Parameters:
byPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection
-
readSortAsync
public <T> RFuture<Collection<T>> readSortAsync(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)
Description copied from interface:RSortableAsyncRead data in sorted view- Specified by:
readSortAsyncin interfaceRSortableAsync<V>- Type Parameters:
T- object type- Parameters:
byPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection
-
readSortAlpha
public List<V> readSortAlpha(SortOrder order)
Description copied from interface:RSortableRead data in sorted view lexicographically- Specified by:
readSortAlphain interfaceRSortable<V>- Parameters:
order- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
public RFuture<List<V>> readSortAlphaAsync(SortOrder order)
Description copied from interface:RSortableAsyncRead data in sorted view lexicographically- Specified by:
readSortAlphaAsyncin interfaceRSortableAsync<V>- Parameters:
order- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
public List<V> readSortAlpha(SortOrder order, int offset, int count)
Description copied from interface:RSortableRead data in sorted view lexicographically- Specified by:
readSortAlphain interfaceRSortable<V>- Parameters:
order- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
public RFuture<List<V>> readSortAlphaAsync(SortOrder order, int offset, int count)
Description copied from interface:RSortableAsyncRead data in sorted view lexicographically- Specified by:
readSortAlphaAsyncin interfaceRSortableAsync<V>- Parameters:
order- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
public List<V> readSortAlpha(String byPattern, SortOrder order)
Description copied from interface:RSortableRead data in sorted view lexicographically- Specified by:
readSortAlphain interfaceRSortable<V>- Parameters:
byPattern- that is used to generate the keys that are used for sortingorder- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
public RFuture<List<V>> readSortAlphaAsync(String byPattern, SortOrder order)
Description copied from interface:RSortableAsyncRead data in sorted view lexicographically- Specified by:
readSortAlphaAsyncin interfaceRSortableAsync<V>- Parameters:
byPattern- that is used to generate the keys that are used for sortingorder- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
public List<V> readSortAlpha(String byPattern, SortOrder order, int offset, int count)
Description copied from interface:RSortableRead data in sorted view lexicographically- Specified by:
readSortAlphain interfaceRSortable<V>- Parameters:
byPattern- that is used to generate the keys that are used for sortingorder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
public RFuture<List<V>> readSortAlphaAsync(String byPattern, SortOrder order, int offset, int count)
Description copied from interface:RSortableAsyncRead data in sorted view lexicographically- Specified by:
readSortAlphaAsyncin interfaceRSortableAsync<V>- Parameters:
byPattern- that is used to generate the keys that are used for sortingorder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
public <T> Collection<T> readSortAlpha(String byPattern, List<String> getPatterns, SortOrder order)
Description copied from interface:RSortableRead data in sorted view lexicographically- Specified by:
readSortAlphain interfaceRSortable<V>- Type Parameters:
T- object type- Parameters:
byPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
public <T> RFuture<Collection<T>> readSortAlphaAsync(String byPattern, List<String> getPatterns, SortOrder order)
Description copied from interface:RSortableAsyncRead data in sorted view lexicographically- Specified by:
readSortAlphaAsyncin interfaceRSortableAsync<V>- Type Parameters:
T- object type- Parameters:
byPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
public <T> Collection<T> readSortAlpha(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)
Description copied from interface:RSortableRead data in sorted view lexicographically- Specified by:
readSortAlphain interfaceRSortable<V>- Type Parameters:
T- object type- Parameters:
byPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
public <T> RFuture<Collection<T>> readSortAlphaAsync(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)
Description copied from interface:RSortableAsyncRead data in sorted view lexicographically- Specified by:
readSortAlphaAsyncin interfaceRSortableAsync<V>- Type Parameters:
T- object type- Parameters:
byPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- sorted collection lexicographically
-
sortTo
public int sortTo(String destName, SortOrder order)
Description copied from interface:RSortableSort data and store todestNamelist
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, SortOrder order)
Description copied from interface:RSortableAsyncSort data and store todestNamelist- Specified by:
sortToAsyncin interfaceRSortableAsync<V>- Parameters:
destName- list object destinationorder- for sorted data- Returns:
- length of sorted data
-
sortTo
public int sortTo(String destName, SortOrder order, int offset, int count)
Description copied from interface:RSortableSort data and store todestNamelist
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, SortOrder order, int offset, int count)
Description copied from interface:RSortableAsyncSort data and store todestNamelist- Specified by:
sortToAsyncin interfaceRSortableAsync<V>- Parameters:
destName- list object destinationorder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- length of sorted data
-
sortTo
public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count)
Description copied from interface:RSortableSort data and store todestNamelist
-
sortTo
public int sortTo(String destName, String byPattern, SortOrder order)
Description copied from interface:RSortableSort data and store todestNamelist
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, String byPattern, SortOrder order)
Description copied from interface:RSortableAsyncSort data and store todestNamelist- Specified by:
sortToAsyncin interfaceRSortableAsync<V>- Parameters:
destName- list object destinationbyPattern- that is used to generate the keys that are used for sortingorder- for sorted data- Returns:
- length of sorted data
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count)
Description copied from interface:RSortableAsyncSort data and store todestNamelist- Specified by:
sortToAsyncin interfaceRSortableAsync<V>- Parameters:
destName- list object destinationbyPattern- that is used to generate the keys that are used for sortingorder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- length of sorted data
-
sortTo
public int sortTo(String destName, String byPattern, List<String> getPatterns, SortOrder order)
Description copied from interface:RSortableSort data and store todestNamelist
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, String byPattern, List<String> getPatterns, SortOrder order)
Description copied from interface:RSortableAsyncSort data and store todestNamelist- Specified by:
sortToAsyncin interfaceRSortableAsync<V>- Parameters:
destName- list object destinationbyPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted data- Returns:
- length of sorted data
-
sortTo
public int sortTo(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)
Description copied from interface:RSortableSort data and store todestNamelist- Specified by:
sortToin interfaceRSortable<V>- Parameters:
destName- list object destinationbyPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- length of sorted data
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)
Description copied from interface:RSortableAsyncSort data and store todestNamelist- Specified by:
sortToAsyncin interfaceRSortableAsync<V>- Parameters:
destName- list object destinationbyPattern- that is used to generate the keys that are used for sortinggetPatterns- that is used to load values by keys in sorted vieworder- for sorted dataoffset- of sorted datacount- of sorted data- Returns:
- length of sorted data
-
rangeAsync
public RFuture<List<V>> rangeAsync(int toIndex)
Description copied from interface:RListAsyncReturns range of values from 0 index totoIndex. Indexes are zero based.-1means the last element,-2means penultimate and so on.- Specified by:
rangeAsyncin interfaceRListAsync<V>- Parameters:
toIndex- - end index- Returns:
- elements
-
rangeAsync
public RFuture<List<V>> rangeAsync(int fromIndex, int toIndex)
Description copied from interface:RListAsyncReturns range of values fromfromIndextotoIndexindex including. Indexes are zero based.-1means the last element,-2means penultimate and so on.- Specified by:
rangeAsyncin interfaceRListAsync<V>- Parameters:
fromIndex- - start indextoIndex- - end index- Returns:
- elements
-
range
public List<V> range(int toIndex)
Description copied from interface:RListReturns range of values from 0 index totoIndex. Indexes are zero based.-1means the last element,-2means penultimate and so on.
-
range
public List<V> range(int fromIndex, int toIndex)
Description copied from interface:RListReturns range of values fromfromIndextotoIndexindex including. Indexes are zero based.-1means the last element,-2means penultimate and so on.
-
addListener
public int addListener(ObjectListener listener)
Description copied from interface:RObjectAdds object event listener- Specified by:
addListenerin interfaceRList<V>- Specified by:
addListenerin interfaceRObject- Overrides:
addListenerin classRedissonObject- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
ExpiredObjectListener,DeletedObjectListener
-
addListenerAsync
public RFuture<Integer> addListenerAsync(ObjectListener listener)
Description copied from interface:RObjectAsyncAdds object event listener- Specified by:
addListenerAsyncin interfaceRListAsync<V>- Specified by:
addListenerAsyncin interfaceRObjectAsync- Overrides:
addListenerAsyncin classRedissonObject- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
ExpiredObjectListener,DeletedObjectListener
-
removeListener
public void removeListener(int listenerId)
Description copied from interface:RObjectRemoves object event listener- Specified by:
removeListenerin interfaceRObject- Overrides:
removeListenerin classRedissonObject- Parameters:
listenerId- - listener id
-
removeListenerAsync
public RFuture<Void> removeListenerAsync(int listenerId)
Description copied from interface:RObjectAsyncRemoves object event listener- Specified by:
removeListenerAsyncin interfaceRObjectAsync- Overrides:
removeListenerAsyncin classRedissonObject- Parameters:
listenerId- - listener id
-
removeIf
public boolean removeIf(Predicate<? super V> filter)
- Specified by:
removeIfin interfaceCollection<V>
-
expire
public boolean expire(long timeToLive, TimeUnit timeUnit)Description copied from interface:RExpirableSet a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirableAsyncSet a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(long timestamp)
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(long timestamp)
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expire
public boolean expire(Instant instant)
Description copied from interface:RExpirableSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
public RFuture<Boolean> expireAsync(Instant instant)
Description copied from interface:RExpirableAsyncSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(Date timestamp)
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(Date timestamp)
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
public boolean clearExpire()
Description copied from interface:RExpirableClear an expire timeout or expire date for object.- Specified by:
clearExpirein interfaceRExpirable- Returns:
trueif timeout was removedfalseif object does not exist or does not have an associated timeout
-
clearExpireAsync
public RFuture<Boolean> clearExpireAsync()
Description copied from interface:RExpirableAsyncClear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsyncin interfaceRExpirableAsync- Returns:
trueif the timeout was cleared andfalseif not
-
remainTimeToLive
public long remainTimeToLive()
Description copied from interface:RExpirableRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLivein 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:RExpirableAsyncRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsyncin 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)
-
-