K - keyV - valuepublic abstract class RedissonMultimap<K,V> extends RedissonObject implements RMultimap<K,V>
codec, commandExecutor| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all key-value pairs from the multimap, leaving it empty.
|
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.
|
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. |
boolean |
containsKey(Object key)
Returns
true if this multimap contains at least one key-value pair
with the key key. |
boolean |
containsValue(Object value)
Returns
true if this multimap contains at least one key-value pair
with the value value. |
RFuture<Boolean> |
deleteAsync()
Delete object in async mode
|
Collection<Map.Entry<K,V>> |
entries()
Returns a view collection of all key-value pairs contained in this
multimap, as
Map.Entry instances. |
boolean |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object in async mode.
|
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.
|
RFuture<Boolean> |
expireAtAsync(long timestamp)
Set an expire date for object in async mode.
|
long |
fastRemove(K... keys)
Removes
keys from map by one operation
Works faster than RMultimap.remove but not returning
the value associated with key |
RFuture<Long> |
fastRemoveAsync(K... keys)
Removes
keys from map by one operation
Works faster than RMultimap.remove but not returning
the value associated with key |
protected <T> RFuture<T> |
fastRemoveAsync(List<Object> mapKeys,
List<Object> listKeys,
RedisCommand<T> evalCommandType) |
Collection<V> |
getAll(K key)
Returns all elements at once.
|
RLock |
getLock(K key)
Returns
RLock instance associated with key |
RReadWriteLock |
getReadWriteLock(K key)
Returns
RReadWriteLock instance associated with key |
protected String |
hash(io.netty.buffer.ByteBuf objectState) |
protected String |
hashAndRelease(io.netty.buffer.ByteBuf objectState) |
boolean |
isEmpty()
Check is map empty
|
Set<K> |
keySet()
Returns a view collection of all distinct keys contained in this
multimap.
|
int |
keySize()
Returns the count of distinct keys in this multimap.
|
RFuture<Integer> |
keySizeAsync()
Returns the number of key-value pairs in this multimap.
|
boolean |
put(K key,
V value)
Stores a key-value pair in this multimap.
|
boolean |
putAll(K key,
Iterable<? extends V> values)
Stores a key-value pair in this multimap for each of
values, all
using the same key, key. |
Set<K> |
readAllKeySet()
Read all keys at once
|
RFuture<Set<K>> |
readAllKeySetAsync()
Read all keys at once
|
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
|
boolean |
remove(Object key,
Object value)
Removes a single key-value pair with the key
key and the value
value from this multimap, if such exists. |
Collection<V> |
removeAll(Object key)
Removes all values associated with the key
key. |
Collection<V> |
replaceValues(K key,
Iterable<? extends V> values)
Stores a collection of values with the same key, replacing any existing
values for that key.
|
int |
size()
Returns the number of key-value pairs in this multimap.
|
Collection<V> |
values()
Returns a view collection containing the value from each key-value
pair contained in this multimap, without collapsing duplicates (so
values().size() == size()). |
await, copy, copyAsync, delete, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, rename, renameAsync, renamenx, renamenxAsync, suffixName, toSeconds, touch, touchAsync, unlink, unlinkAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearExpire, expire, expireAt, expireAt, remainTimeToLivecopy, delete, getCodec, getName, isExists, migrate, move, rename, renamenx, touch, unlinkcontainsEntryAsync, containsKeyAsync, containsValueAsync, getAllAsync, putAllAsync, putAsync, removeAllAsync, removeAsync, replaceValuesAsync, sizeAsyncexpireAtAsync, remainTimeToLiveAsynccopyAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, touchAsync, unlinkAsyncpublic RLock getLock(K key)
RMultimapRLock instance associated with keypublic RReadWriteLock getReadWriteLock(K key)
RMultimapRReadWriteLock instance associated with keygetReadWriteLock in interface RMultimap<K,V>key - - map keyprotected String hash(io.netty.buffer.ByteBuf objectState)
protected String hashAndRelease(io.netty.buffer.ByteBuf objectState)
public int size()
RMultimappublic int keySize()
RMultimappublic boolean isEmpty()
RMultimappublic boolean containsKey(Object key)
RMultimaptrue if this multimap contains at least one key-value pair
with the key key.containsKey in interface RMultimap<K,V>key - - map keytrue if contains a keypublic boolean containsValue(Object value)
RMultimaptrue if this multimap contains at least one key-value pair
with the value value.containsValue in interface RMultimap<K,V>value - - map valuetrue if contains a valuepublic boolean containsEntry(Object key, Object value)
RMultimaptrue if this multimap contains at least one key-value pair
with the key key and the value value.containsEntry in interface RMultimap<K,V>key - - map keyvalue - - map valuetrue if contains an entrypublic boolean put(K key, V value)
RMultimapSome 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 boolean remove(Object key, Object value)
RMultimapkey 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.public boolean putAll(K key, Iterable<? extends V> values)
RMultimapvalues, 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.
public void clear()
RMultimappublic Set<K> keySet()
RMultimapChanges to the returned set will update the underlying multimap, and vice versa. However, adding to the returned set is not possible.
public Collection<V> values()
RMultimapvalues().size() == size()).
Changes to the returned collection will update the underlying multimap, and vice versa. However, adding to the returned collection is not possible.
public Collection<V> getAll(K key)
RMultimappublic Collection<V> removeAll(Object key)
RMultimapkey.
Once this method returns, key will not be mapped to any values
Use RMultimap.fastRemove(K...) if values are not needed.
public Collection<V> replaceValues(K key, Iterable<? extends V> values)
RMultimapIf values is empty, this is equivalent to
removeAll(key).
replaceValues in interface RMultimap<K,V>key - - map keyvalues - - map valuespublic Collection<Map.Entry<K,V>> entries()
RMultimapMap.Entry instances.
Changes to the returned collection or the entries it contains will update the underlying multimap, and vice versa. However, adding to the returned collection is not possible.
public Set<K> readAllKeySet()
RMultimapreadAllKeySet in interface RMultimap<K,V>public RFuture<Set<K>> readAllKeySetAsync()
RMultimapAsyncreadAllKeySetAsync in interface RMultimapAsync<K,V>public long fastRemove(K... keys)
RMultimapkeys from map by one operation
Works faster than RMultimap.remove but not returning
the value associated with keyfastRemove in interface RMultimap<K,V>keys - - map keyspublic RFuture<Long> fastRemoveAsync(K... keys)
RMultimapAsynckeys from map by one operation
Works faster than RMultimap.remove but not returning
the value associated with keyfastRemoveAsync in interface RMultimapAsync<K,V>keys - - map keysprotected <T> RFuture<T> fastRemoveAsync(List<Object> mapKeys, List<Object> listKeys, RedisCommand<T> evalCommandType)
public RFuture<Boolean> deleteAsync()
RObjectAsyncdeleteAsync in interface RObjectAsyncdeleteAsync in class RedissonObjecttrue if object was deleted false if notpublic RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsyncexpireAsync in interface RExpirableAsynctimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire date in seconds (Unix timestamp)true if the timeout was set and false if notpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsyncclearExpireAsync in interface RExpirableAsynctrue if the timeout was cleared and false if notpublic RFuture<Integer> keySizeAsync()
RMultimapAsynckeySizeAsync in interface RMultimapAsync<K,V>public boolean expire(long timeToLive,
TimeUnit timeUnit)
RExpirableexpire in interface RExpirabletimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic boolean expireAt(long timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire date in milliseconds (Unix timestamp)true if the timeout was set and false if notpublic boolean expireAt(Date timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire datetrue if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire datetrue if the timeout was set and false if notpublic boolean clearExpire()
RExpirableclearExpire in interface RExpirabletrue if timeout was removed
false if object does not exist or does not have an associated timeoutpublic long remainTimeToLive()
RExpirableremainTimeToLive in interface RExpirablepublic RFuture<Long> remainTimeToLiveAsync()
RExpirableAsyncremainTimeToLiveAsync in interface RExpirableAsyncCopyright © 2014–2018 The Redisson Project. All rights reserved.