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 void
add(int index, V element)
boolean
add(V e)
int
addAfter(V elementToFind, V element)
Addelement
afterelementToFind
RFuture<Integer>
addAfterAsync(V elementToFind, V element)
Insertselement
afterelementToFind
boolean
addAll(int index, Collection<? extends V> coll)
boolean
addAll(Collection<? extends V> c)
RFuture<Boolean>
addAllAsync(int index, Collection<? extends V> coll)
Insertselements
atindex
.RFuture<Boolean>
addAllAsync(Collection<? extends V> c)
Adds all elements contained in the specified collectionRFuture<Boolean>
addAsync(int index, V element)
Insertselement
atindex
.RFuture<Boolean>
addAsync(V e)
Adds element into this collection.protected <T> RFuture<T>
addAsync(V e, RedisCommand<T> command)
int
addBefore(V elementToFind, V element)
Addelement
beforeelementToFind
RFuture<Integer>
addBeforeAsync(V elementToFind, V element)
Insertselement
beforeelementToFind
int
addListener(ObjectListener listener)
Adds object event listenerRFuture<Integer>
addListenerAsync(ObjectListener listener)
Adds object event listenervoid
clear()
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)
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
RFuture<Boolean>
containsAllAsync(Collection<?> c)
Returnstrue
if this collection contains all of the elements in the specified collection.RFuture<Boolean>
containsAsync(Object o)
Returnstrue
if this collection contains encoded state of the specified element.boolean
equals(Object o)
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)
insteadvoid
fastRemove(int index)
Remove object by specified indexRFuture<Void>
fastRemoveAsync(int index)
Removes element atindex
.void
fastSet(int index, V element)
Setelement
atindex
.RFuture<Void>
fastSetAsync(int index, V element)
Setelement
atindex
.V
get(int index)
List<V>
get(int... indexes)
Loads elements by specifiedindexes
RFuture<V>
getAsync(int index)
Get element atindex
RFuture<List<V>>
getAsync(int... indexes)
Loads elements by specifiedindexes
int
hashCode()
int
indexOf(Object o)
RFuture<Integer>
indexOfAsync(Object o)
Returns last index ofelement
or -1 if element isn't found<R> RFuture<R>
indexOfAsync(Object o, Convertor<R> convertor)
boolean
isEmpty()
Iterator<V>
iterator()
int
lastIndexOf(Object o)
RFuture<Integer>
lastIndexOfAsync(Object o)
Returns last index ofelement
or -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()
ReturnsRMapReduce
object 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 fromfromIndex
totoIndex
index 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 fromfromIndex
totoIndex
index 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 viewlong
remainTimeToLive()
Remaining time to live of Redisson object that has a timeoutRFuture<Long>
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeoutV
remove(int index)
boolean
remove(Object o)
boolean
remove(Object o, int count)
Removes up tocount
occurrences ofelement
boolean
removeAll(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 tocount
occurrences ofelement
boolean
removeIf(Predicate<? super V> filter)
void
removeListener(int listenerId)
Removes object event listenerRFuture<Void>
removeListenerAsync(int listenerId)
Removes object event listenerboolean
retainAll(Collection<?> c)
RFuture<Boolean>
retainAllAsync(Collection<?> c)
Retains only the elements in this collection that are contained in the specified collection.V
set(int index, V element)
RFuture<V>
setAsync(int index, V element)
Setelement
atindex
and returns previous element.int
size()
RFuture<Integer>
sizeAsync()
Returns number of elements in this collection.int
sortTo(String destName, String byPattern, List<String> getPatterns, SortOrder order)
Sort data and store todestName
listint
sortTo(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)
Sort data and store todestName
listint
sortTo(String destName, String byPattern, SortOrder order)
Sort data and store todestName
listint
sortTo(String destName, String byPattern, SortOrder order, int offset, int count)
Sort data and store todestName
listint
sortTo(String destName, SortOrder order)
Sort data and store todestName
listint
sortTo(String destName, SortOrder order, int offset, int count)
Sort data and store todestName
listRFuture<Integer>
sortToAsync(String destName, String byPattern, List<String> getPatterns, SortOrder order)
Sort data and store todestName
listRFuture<Integer>
sortToAsync(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count)
Sort data and store todestName
listRFuture<Integer>
sortToAsync(String destName, String byPattern, SortOrder order)
Sort data and store todestName
listRFuture<Integer>
sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count)
Sort data and store todestName
listRFuture<Integer>
sortToAsync(String destName, SortOrder order)
Sort data and store todestName
listRFuture<Integer>
sortToAsync(String destName, SortOrder order, int offset, int count)
Sort data and store todestName
listRList<V>
subList(int fromIndex, int toIndex)
Object[]
toArray()
<T> T[]
toArray(T[] a)
String
toString()
void
trim(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:RList
ReturnsRMapReduce
object associated with this map
-
size
public int size()
-
sizeAsync
public RFuture<Integer> sizeAsync()
Description copied from interface:RCollectionAsync
Returns number of elements in this collection.- Specified by:
sizeAsync
in 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:RListAsync
Read all elements at once- Specified by:
readAllAsync
in 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:RCollectionAsync
Adds element into this collection.- Specified by:
addAsync
in interfaceRCollectionAsync<V>
- Parameters:
e
- - element to add- Returns:
true
if an element was added andfalse
if 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:RCollectionAsync
Removes a single instance of the specified element from this collection, if it is present.- Specified by:
removeAsync
in interfaceRCollectionAsync<V>
- Parameters:
o
- element to be removed from this collection, if present- Returns:
true
if an element was removed as a result of this call
-
removeAsync
public RFuture<Boolean> removeAsync(Object o, int count)
Description copied from interface:RListAsync
Removes up tocount
occurrences ofelement
- Specified by:
removeAsync
in interfaceRListAsync<V>
- Parameters:
o
- - element to findcount
- - amount occurrences- Returns:
true
if at least one element removed; orfalse
if element isn't found
-
remove
public boolean remove(Object o, int count)
Description copied from interface:RList
Removes up tocount
occurrences ofelement
-
containsAllAsync
public RFuture<Boolean> containsAllAsync(Collection<?> c)
Description copied from interface:RCollectionAsync
Returnstrue
if this collection contains all of the elements in the specified collection.- Specified by:
containsAllAsync
in interfaceRCollectionAsync<V>
- Parameters:
c
- collection to be checked for containment in this collection- Returns:
true
if this collection contains all of the elements in the specified collection
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<V>
- Specified by:
containsAll
in interfaceList<V>
-
addAll
public boolean addAll(Collection<? extends V> c)
-
addAllAsync
public RFuture<Boolean> addAllAsync(Collection<? extends V> c)
Description copied from interface:RCollectionAsync
Adds all elements contained in the specified collection- Specified by:
addAllAsync
in interfaceRCollectionAsync<V>
- Parameters:
c
- - collection of elements to add- Returns:
true
if at least one element was added andfalse
if all elements are already present
-
addAllAsync
public RFuture<Boolean> addAllAsync(int index, Collection<? extends V> coll)
Description copied from interface:RListAsync
Insertselements
atindex
. Subsequent elements are shifted.- Specified by:
addAllAsync
in interfaceRListAsync<V>
- Parameters:
index
- - index numbercoll
- - elements to insert- Returns:
true
if list changed orfalse
if 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:RCollectionAsync
Removes all of this collection's elements that are also contained in the specified collection.- Specified by:
removeAllAsync
in interfaceRCollectionAsync<V>
- Parameters:
c
- collection containing elements to be removed from this collection- Returns:
true
if 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:RCollectionAsync
Retains only the elements in this collection that are contained in the specified collection.- Specified by:
retainAllAsync
in interfaceRCollectionAsync<V>
- Parameters:
c
- collection containing elements to be retained in this collection- Returns:
true
if this collection changed as a result of the call
-
clear
public void clear()
-
getAsync
public RFuture<V> getAsync(int index)
Description copied from interface:RListAsync
Get element atindex
- Specified by:
getAsync
in interfaceRListAsync<V>
- Parameters:
index
- - index of object- Returns:
- element
-
get
public List<V> get(int... indexes)
Description copied from interface:RList
Loads elements by specifiedindexes
-
getAsync
public RFuture<List<V>> getAsync(int... indexes)
Description copied from interface:RListAsync
Loads elements by specifiedindexes
- Specified by:
getAsync
in interfaceRListAsync<V>
- Parameters:
indexes
- of elements- Returns:
- elements
-
setAsync
public RFuture<V> setAsync(int index, V element)
Description copied from interface:RListAsync
Setelement
atindex
and returns previous element.- Specified by:
setAsync
in interfaceRListAsync<V>
- Parameters:
index
- - index of objectelement
- - object- Returns:
- previous element or
null
if element wasn't set.
-
fastSetAsync
public RFuture<Void> fastSetAsync(int index, V element)
Description copied from interface:RListAsync
Setelement
atindex
. Works faster thanRListAsync.setAsync(int, Object)
but doesn't return previous element.- Specified by:
fastSetAsync
in interfaceRListAsync<V>
- Parameters:
index
- - index of objectelement
- - object- Returns:
- void
-
addAsync
public RFuture<Boolean> addAsync(int index, V element)
Description copied from interface:RListAsync
Insertselement
atindex
. Subsequent elements are shifted.- Specified by:
addAsync
in interfaceRListAsync<V>
- Parameters:
index
- - index numberelement
- - element to insert- Returns:
true
if list was changed
-
removeAsync
public RFuture<V> removeAsync(int index)
Description copied from interface:RListAsync
Removes element atindex
.- Specified by:
removeAsync
in interfaceRListAsync<V>
- Parameters:
index
- - index of object- Returns:
- element or
null
if element wasn't set.
-
fastRemove
public void fastRemove(int index)
Description copied from interface:RList
Remove object by specified index- Specified by:
fastRemove
in interfaceRList<V>
- Parameters:
index
- - index of object
-
fastRemoveAsync
public RFuture<Void> fastRemoveAsync(int index)
Description copied from interface:RListAsync
Removes element atindex
. Works faster thanRListAsync.removeAsync(Object, int)
but doesn't return element.- Specified by:
fastRemoveAsync
in interfaceRListAsync<V>
- Parameters:
index
- - index of object- Returns:
- void
-
containsAsync
public RFuture<Boolean> containsAsync(Object o)
Description copied from interface:RCollectionAsync
Returnstrue
if this collection contains encoded state of the specified element.- Specified by:
containsAsync
in interfaceRCollectionAsync<V>
- Parameters:
o
- element whose presence in this collection is to be tested- Returns:
true
if this collection contains the specified element andfalse
otherwise
-
indexOfAsync
public RFuture<Integer> indexOfAsync(Object o)
Description copied from interface:RListAsync
Returns last index ofelement
or -1 if element isn't found- Specified by:
indexOfAsync
in interfaceRListAsync<V>
- Parameters:
o
- to find- Returns:
- index of -1 if element isn't found
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<V>
-
lastIndexOfAsync
public RFuture<Integer> lastIndexOfAsync(Object o)
Description copied from interface:RListAsync
Returns last index ofelement
or -1 if element isn't found- Specified by:
lastIndexOfAsync
in 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:RList
Trim list and remains elements only in specified rangefromIndex
, inclusive, andtoIndex
, inclusive.
-
trimAsync
public RFuture<Void> trimAsync(int fromIndex, int toIndex)
Description copied from interface:RListAsync
Trim list and remains elements only in specified rangefromIndex
, inclusive, andtoIndex
, inclusive.- Specified by:
trimAsync
in interfaceRListAsync<V>
- Parameters:
fromIndex
- - from indextoIndex
- - to index- Returns:
- void
-
listIterator
public ListIterator<V> listIterator()
- Specified by:
listIterator
in interfaceList<V>
-
listIterator
public ListIterator<V> listIterator(int ind)
- Specified by:
listIterator
in 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:RListAsync
Insertselement
afterelementToFind
- Specified by:
addAfterAsync
in 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:RListAsync
Insertselement
beforeelementToFind
- Specified by:
addBeforeAsync
in 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:RList
Addelement
afterelementToFind
-
addBefore
public int addBefore(V elementToFind, V element)
Description copied from interface:RList
Addelement
beforeelementToFind
-
readSort
public List<V> readSort(SortOrder order)
Description copied from interface:RSortable
Read data in sorted view
-
readSortAsync
public RFuture<List<V>> readSortAsync(SortOrder order)
Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in 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:RSortable
Read data in sorted view
-
readSortAsync
public RFuture<List<V>> readSortAsync(SortOrder order, int offset, int count)
Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in 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:RSortable
Read data in sorted view
-
readSortAsync
public RFuture<List<V>> readSortAsync(String byPattern, SortOrder order)
Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in 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:RSortable
Read data in sorted view
-
readSortAsync
public RFuture<List<V>> readSortAsync(String byPattern, SortOrder order, int offset, int count)
Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in 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:RSortable
Read data in sorted view
-
readSortAsync
public <T> RFuture<Collection<T>> readSortAsync(String byPattern, List<String> getPatterns, SortOrder order)
Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in 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:RSortable
Read data in sorted view- Specified by:
readSort
in 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:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in 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:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in interfaceRSortable<V>
- Parameters:
order
- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
public RFuture<List<V>> readSortAlphaAsync(SortOrder order)
Description copied from interface:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in 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:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in 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:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in 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:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in 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:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in 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:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in 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:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in 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:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in 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:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in 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:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in 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:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in 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:RSortable
Sort data and store todestName
list
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, SortOrder order)
Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in 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:RSortable
Sort data and store todestName
list
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, SortOrder order, int offset, int count)
Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in 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:RSortable
Sort data and store todestName
list
-
sortTo
public int sortTo(String destName, String byPattern, SortOrder order)
Description copied from interface:RSortable
Sort data and store todestName
list
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, String byPattern, SortOrder order)
Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in 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:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in 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:RSortable
Sort data and store todestName
list
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, String byPattern, List<String> getPatterns, SortOrder order)
Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in 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:RSortable
Sort data and store todestName
list- Specified by:
sortTo
in 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:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in 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:RListAsync
Returns range of values from 0 index totoIndex
. Indexes are zero based.-1
means the last element,-2
means penultimate and so on.- Specified by:
rangeAsync
in interfaceRListAsync<V>
- Parameters:
toIndex
- - end index- Returns:
- elements
-
rangeAsync
public RFuture<List<V>> rangeAsync(int fromIndex, int toIndex)
Description copied from interface:RListAsync
Returns range of values fromfromIndex
totoIndex
index including. Indexes are zero based.-1
means the last element,-2
means penultimate and so on.- Specified by:
rangeAsync
in interfaceRListAsync<V>
- Parameters:
fromIndex
- - start indextoIndex
- - end index- Returns:
- elements
-
range
public List<V> range(int toIndex)
Description copied from interface:RList
Returns range of values from 0 index totoIndex
. Indexes are zero based.-1
means the last element,-2
means penultimate and so on.
-
range
public List<V> range(int fromIndex, int toIndex)
Description copied from interface:RList
Returns range of values fromfromIndex
totoIndex
index including. Indexes are zero based.-1
means the last element,-2
means penultimate and so on.
-
addListener
public int addListener(ObjectListener listener)
Description copied from interface:RObject
Adds object event listener- Specified by:
addListener
in interfaceRList<V>
- Specified by:
addListener
in interfaceRObject
- Overrides:
addListener
in classRedissonObject
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
ExpiredObjectListener
,DeletedObjectListener
-
addListenerAsync
public RFuture<Integer> addListenerAsync(ObjectListener listener)
Description copied from interface:RObjectAsync
Adds object event listener- Specified by:
addListenerAsync
in interfaceRListAsync<V>
- Specified by:
addListenerAsync
in interfaceRObjectAsync
- Overrides:
addListenerAsync
in classRedissonObject
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
ExpiredObjectListener
,DeletedObjectListener
-
removeListener
public void removeListener(int listenerId)
Description copied from interface:RObject
Removes object event listener- Specified by:
removeListener
in interfaceRObject
- Overrides:
removeListener
in classRedissonObject
- Parameters:
listenerId
- - listener id
-
removeListenerAsync
public RFuture<Void> removeListenerAsync(int listenerId)
Description copied from interface:RObjectAsync
Removes object event listener- Specified by:
removeListenerAsync
in interfaceRObjectAsync
- Overrides:
removeListenerAsync
in classRedissonObject
- Parameters:
listenerId
- - listener id
-
removeIf
public boolean removeIf(Predicate<? super V> filter)
- Specified by:
removeIf
in interfaceCollection<V>
-
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)
-
-