K
- keyV
- valuepublic class RedissonListMultimap<K,V> extends RedissonMultimap<K,V> implements RListMultimap<K,V>
codec, commandExecutor, name
Constructor and Description |
---|
RedissonListMultimap(Codec codec,
CommandAsyncExecutor connectionManager,
String name) |
RedissonListMultimap(CommandAsyncExecutor connectionManager,
String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
clearExpire()
Clear an expire timeout or expire date for object.
|
protected RFuture<Boolean> |
clearExpireAsync(String... keys) |
boolean |
containsEntry(Object key,
Object value)
Returns
true if this multimap contains at least one key-value pair
with the key key and the value value . |
RFuture<Boolean> |
containsEntryAsync(Object key,
Object value)
Returns
true if this multimap contains at least one key-value pair
with the key key and the value value . |
RFuture<Boolean> |
containsKeyAsync(Object key)
Returns
true if this multimap contains at least one key-value pair
with the key key . |
RFuture<Boolean> |
containsValueAsync(Object value)
Returns
true if this multimap contains at least one key-value pair
with the value value . |
boolean |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
protected RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit,
String... keys) |
boolean |
expireAt(Date timestamp)
Set an expire date for object.
|
boolean |
expireAt(long timestamp)
Set an expire date for object.
|
RFuture<Boolean> |
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.
|
protected RFuture<Boolean> |
expireAtAsync(long timestamp,
String... keys) |
RList<V> |
get(K key)
Returns a view collection of the values associated with
key in this
multimap, if any. |
List<V> |
getAll(K key)
Returns all elements at once.
|
RFuture<Collection<V>> |
getAllAsync(K key) |
boolean |
put(K key,
V value)
Stores a key-value pair in this multimap.
|
RFuture<Boolean> |
putAllAsync(K key,
Iterable<? extends V> values)
Stores a key-value pair in this multimap for each of
values , all
using the same key, key . |
RFuture<Boolean> |
putAsync(K key,
V value)
Stores a key-value pair in this multimap.
|
long |
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout
|
RFuture<Long> |
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeout
|
List<V> |
removeAll(Object key)
Removes all values associated with the key
key . |
RFuture<Collection<V>> |
removeAllAsync(Object key)
Removes all values associated with the key
key . |
RFuture<Boolean> |
removeAsync(Object key,
Object value)
Removes a single key-value pair with the key
key and the value
value from this multimap, if such exists. |
List<V> |
replaceValues(K key,
Iterable<? extends V> values)
Stores a collection of values with the same key, replacing any existing
values for that key.
|
RFuture<Collection<V>> |
replaceValuesAsync(K key,
Iterable<? extends V> values)
Stores a collection of values with the same key, replacing any existing
values for that key.
|
RFuture<Integer> |
sizeAsync()
Returns the number of key-value pairs in this multimap.
|
clear, clearExpireAsync, containsKey, containsValue, deleteAsync, entries, expireAsync, expireAtAsync, fastRemove, fastRemoveAsync, fastRemoveAsync, getCountDownLatch, getFairLock, getLock, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, hash, isEmpty, keyHash, keySet, keySize, keySizeAsync, putAll, readAllKeySet, readAllKeySetAsync, remove, renameAsync, renamenxAsync, size, values
addListener, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getLockByMapKey, getLockByValue, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, containsKey, containsValue, entries, fastRemove, getCountDownLatch, getFairLock, getLock, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, isEmpty, keySet, keySize, putAll, readAllKeySet, remove, size, values
clearExpire, expire, expireAt, expireAt, remainTimeToLive
addListener, copy, delete, dump, getCodec, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
fastRemoveAsync, keySizeAsync, readAllKeySetAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
public RedissonListMultimap(CommandAsyncExecutor connectionManager, String name)
public RedissonListMultimap(Codec codec, CommandAsyncExecutor connectionManager, String name)
public RFuture<Integer> sizeAsync()
RMultimapAsync
sizeAsync
in interface RMultimapAsync<K,V>
public RFuture<Boolean> containsKeyAsync(Object key)
RMultimapAsync
true
if this multimap contains at least one key-value pair
with the key key
.containsKeyAsync
in interface RMultimapAsync<K,V>
key
- - map keytrue
if contains a keypublic RFuture<Boolean> containsValueAsync(Object value)
RMultimapAsync
true
if this multimap contains at least one key-value pair
with the value value
.containsValueAsync
in interface RMultimapAsync<K,V>
value
- - map valuetrue
if contains a valuepublic boolean containsEntry(Object key, Object value)
RMultimap
true
if this multimap contains at least one key-value pair
with the key key
and the value value
.containsEntry
in interface RMultimap<K,V>
containsEntry
in class RedissonMultimap<K,V>
key
- - map keyvalue
- - map valuetrue
if contains an entrypublic RFuture<Boolean> containsEntryAsync(Object key, Object value)
RMultimapAsync
true
if this multimap contains at least one key-value pair
with the key key
and the value value
.containsEntryAsync
in interface RMultimapAsync<K,V>
key
- - map keyvalue
- - map valuetrue
if contains an entrypublic boolean put(K key, V value)
RMultimap
Some multimap implementations allow duplicate key-value pairs, in which
case put
always adds a new key-value pair and increases the
multimap size by 1. Other implementations prohibit duplicates, and storing
a key-value pair that's already in the multimap has no effect.
public RFuture<Boolean> putAsync(K key, V value)
RMultimapAsync
Some multimap implementations allow duplicate key-value pairs, in which
case put
always adds a new key-value pair and increases the
multimap size by 1. Other implementations prohibit duplicates, and storing
a key-value pair that's already in the multimap has no effect.
putAsync
in interface RMultimapAsync<K,V>
key
- - map keyvalue
- - map valuetrue
if the method increased the size of the multimap, or
false
if the multimap already contained the key-value pair and
doesn't allow duplicatespublic RFuture<Boolean> removeAsync(Object key, Object value)
RMultimapAsync
key
and the value
value
from this multimap, if such exists. If multiple key-value
pairs in the multimap fit this description, which one is removed is
unspecified.removeAsync
in interface RMultimapAsync<K,V>
key
- - map keyvalue
- - map valuetrue
if the multimap changedpublic RFuture<Boolean> putAllAsync(K key, Iterable<? extends V> values)
RMultimapAsync
values
, all
using the same key, key
. Equivalent to (but expected to be more
efficient than):
for (V value : values) {
put(key, value);
}
In particular, this is a no-op if values
is empty.
putAllAsync
in interface RMultimapAsync<K,V>
key
- - map keyvalues
- - map valuestrue
if the multimap changedpublic RList<V> get(K key)
RListMultimap
key
in this
multimap, if any. Note that when containsKey(key)
is false, this
returns an empty collection, not null
.
Changes to the returned collection will update the underlying multimap, and vice versa.
Because a RListMultimap
may has duplicates among values mapped by key and stores insertion order
method returns a List
, instead of the Collection
specified in the RMultimap
interface.
public List<V> getAll(K key)
RMultimap
public RFuture<Collection<V>> getAllAsync(K key)
getAllAsync
in interface RMultimapAsync<K,V>
public List<V> removeAll(Object key)
RMultimap
key
.
Once this method returns, key
will not be mapped to any values
Use RMultimap.fastRemove(K...)
if values are not needed.
removeAll
in interface RListMultimap<K,V>
removeAll
in interface RMultimap<K,V>
removeAll
in class RedissonMultimap<K,V>
key
- - map keypublic RFuture<Collection<V>> removeAllAsync(Object key)
RMultimapAsync
key
.
Once this method returns, key
will not be mapped to any values.
removeAllAsync
in interface RMultimapAsync<K,V>
key
- - map keypublic List<V> replaceValues(K key, Iterable<? extends V> values)
RMultimap
If values
is empty, this is equivalent to
removeAll(key)
.
replaceValues
in interface RListMultimap<K,V>
replaceValues
in interface RMultimap<K,V>
replaceValues
in class RedissonMultimap<K,V>
key
- - map keyvalues
- - map valuespublic RFuture<Collection<V>> replaceValuesAsync(K key, Iterable<? extends V> values)
RMultimapAsync
If values
is empty, this is equivalent to
RMultimapAsync.removeAllAsync(Object)
.
replaceValuesAsync
in interface RMultimapAsync<K,V>
key
- - map keyvalues
- - map valuespublic boolean expire(long timeToLive, TimeUnit timeUnit)
RExpirable
expire
in interface RExpirable
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic boolean expireAt(long timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic boolean expireAt(Date timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic boolean clearExpire()
RExpirable
clearExpire
in interface RExpirable
true
if timeout was removed
false
if object does not exist or does not have an associated timeoutpublic long remainTimeToLive()
RExpirable
remainTimeToLive
in interface RExpirable
public RFuture<Long> remainTimeToLiveAsync()
RExpirableAsync
remainTimeToLiveAsync
in interface RExpirableAsync
protected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
Copyright © 2014–2020 Redisson. All rights reserved.