K
- keyV
- valuepublic class RedissonSetMultimap<K,V> extends RedissonMultimap<K,V> implements RSetMultimap<K,V>
codec, commandExecutor
Constructor and Description |
---|
RedissonSetMultimap(UUID id,
Codec codec,
CommandAsyncExecutor connectionManager,
String name) |
RedissonSetMultimap(UUID id,
CommandAsyncExecutor connectionManager,
String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
clearExpire()
Clear an expire timeout or expire date for object.
|
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 . |
Set<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.
|
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.
|
RSet<V> |
get(K key)
Returns a view collection of the values associated with
key in this
multimap, if any. |
Set<V> |
getAll(K key)
Returns all elements at once.
|
RFuture<Collection<V>> |
getAllAsync(K key) |
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()
Get remaining time to live of object in seconds.
|
Set<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. |
Set<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, containsEntry, containsKey, containsValue, deleteAsync, expireAsync, expireAtAsync, fastRemove, fastRemoveAsync, fastRemoveAsync, getLock, getReadWriteLock, hash, hashAndRelease, isEmpty, keySet, keySize, keySizeAsync, put, putAll, readAllKeySet, readAllKeySetAsync, remove, size, values
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
clear, containsEntry, containsKey, containsValue, fastRemove, getLock, getReadWriteLock, isEmpty, keySet, keySize, put, putAll, readAllKeySet, remove, size, values
clearExpire, expire, expireAt, expireAt, remainTimeToLive
delete, getCodec, getName, isExists, migrate, move, rename, renamenx, touch, unlink
fastRemoveAsync, keySizeAsync, readAllKeySetAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
deleteAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, touchAsync, unlinkAsync
public RedissonSetMultimap(UUID id, CommandAsyncExecutor connectionManager, String name)
public RedissonSetMultimap(UUID id, 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 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 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 RSet<V> get(K key)
RSetMultimap
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 RSetMultiMap
has unique values for a given key, this
method returns a Set
, instead of the Collection
specified in the RMultimap
interface.
public Set<V> getAll(K key)
RMultimap
public RFuture<Collection<V>> getAllAsync(K key)
getAllAsync
in interface RMultimapAsync<K,V>
public Set<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 RMultimap<K,V>
removeAll
in interface RSetMultimap<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 Set<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<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>
replaceValues
in interface RSetMultimap<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
-1
if object does not exist or time in secondsCopyright © 2014–2017 The Redisson Project. All rights reserved.