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()
Get remaining time to live of object in seconds.
|
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, delete, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, newPromise, newSucceededFuture, prefixName, rename, renameAsync, renamenx, renamenxAsync, suffixName, touch, touchAsync, unlink, unlinkAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearExpire, expire, expireAt, expireAt, remainTimeToLive
delete, getCodec, getName, isExists, migrate, move, rename, renamenx, touch, unlink
containsEntryAsync, containsKeyAsync, containsValueAsync, getAllAsync, putAllAsync, putAsync, removeAllAsync, removeAsync, replaceValuesAsync, sizeAsync
expireAtAsync, remainTimeToLiveAsync
isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, touchAsync, unlinkAsync
public RLock getLock(K key)
RMultimap
RLock
instance associated with keypublic RReadWriteLock getReadWriteLock(K key)
RMultimap
RReadWriteLock
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()
RMultimap
public int keySize()
RMultimap
public boolean isEmpty()
RMultimap
public boolean containsKey(Object key)
RMultimap
true
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)
RMultimap
true
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)
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>
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 boolean remove(Object key, Object value)
RMultimap
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.public boolean putAll(K key, Iterable<? extends V> values)
RMultimap
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.
public void clear()
RMultimap
public Set<K> keySet()
RMultimap
Changes 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()
RMultimap
values().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)
RMultimap
public Collection<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.
public Collection<V> replaceValues(K key, Iterable<? extends V> values)
RMultimap
If 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()
RMultimap
Map.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()
RMultimap
readAllKeySet
in interface RMultimap<K,V>
public RFuture<Set<K>> readAllKeySetAsync()
RMultimapAsync
readAllKeySetAsync
in interface RMultimapAsync<K,V>
public long fastRemove(K... keys)
RMultimap
keys
from map by one operation
Works faster than RMultimap.remove
but not returning
the value associated with key
fastRemove
in interface RMultimap<K,V>
keys
- - map keyspublic RFuture<Long> fastRemoveAsync(K... keys)
RMultimapAsync
keys
from map by one operation
Works faster than RMultimap.remove
but not returning
the value associated with key
fastRemoveAsync
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()
RObjectAsync
deleteAsync
in interface RObjectAsync
deleteAsync
in class RedissonObject
true
if object was deleted false
if notpublic RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsync
expireAsync
in interface RExpirableAsync
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire date in seconds (Unix timestamp)true
if the timeout was set and false
if notpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsync
clearExpireAsync
in interface RExpirableAsync
true
if the timeout was cleared and false
if notpublic RFuture<Integer> keySizeAsync()
RMultimapAsync
keySizeAsync
in interface RMultimapAsync<K,V>
public 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
-1
if object does not exist or time in secondsCopyright © 2014–2017 The Redisson Project. All rights reserved.