Package org.redisson.api
Interface RMultimapAsync<K,V>
- Type Parameters:
K- keyV- value
- All Superinterfaces:
RExpirableAsync,RObjectAsync
- All Known Subinterfaces:
RListMultimap<K,,V> RListMultimapCache<K,,V> RListMultimapCacheNative<K,,V> RMultimap<K,,V> RMultimapCache<K,,V> RMultimapCacheAsync<K,,V> RSetMultimap<K,,V> RSetMultimapCache<K,,V> RSetMultimapCacheNative<K,V>
- All Known Implementing Classes:
RedissonListMultimap,RedissonListMultimapCache,RedissonListMultimapCacheNative,RedissonMultimap,RedissonSetMultimap,RedissonSetMultimapCache,RedissonSetMultimapCacheNative
Base asynchronous MultiMap interface. A collection that maps multiple values per one key.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptioncontainsEntryAsync(Object key, Object value) Returnstrueif this multimap contains at least one key-value pair with the keykeyand the valuevalue.containsKeyAsync(Object key) Returnstrueif this multimap contains at least one key-value pair with the keykey.containsValueAsync(Object value) Returnstrueif this multimap contains at least one key-value pair with the valuevalue.fastRemoveAsync(K... keys) Removeskeysfrom map by one operation Works faster thanRMultimap.removebut not returning the value associated withkeyfastRemoveValueAsync(V... values) Removesvaluesfrom map by one operationgetAllAsync(K key) Returns the number of key-value pairs in this multimap.putAllAsync(K key, Iterable<? extends V> values) Stores a key-value pair in this multimap for each ofvalues, all using the same key,key.Stores a key-value pair in this multimap.Read all keys at onceremoveAllAsync(Object key) Removes all values associated with the keykey.removeAsync(Object key, Object value) Removes a single key-value pair with the keykeyand the valuevaluefrom this multimap, if such exists.replaceValuesAsync(K key, Iterable<? extends V> values) Stores a collection of values with the same key, replacing any existing values for that key.Returns the number of key-value pairs in this multimap.Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
sizeAsync
Returns the number of key-value pairs in this multimap.- Returns:
- size of multimap
-
containsKeyAsync
Returnstrueif this multimap contains at least one key-value pair with the keykey.- Parameters:
key- - map key- Returns:
trueif contains a key
-
containsValueAsync
Returnstrueif this multimap contains at least one key-value pair with the valuevalue.- Parameters:
value- - map value- Returns:
trueif contains a value
-
containsEntryAsync
Returnstrueif this multimap contains at least one key-value pair with the keykeyand the valuevalue.- Parameters:
key- - map keyvalue- - map value- Returns:
trueif contains an entry
-
putAsync
Stores a key-value pair in this multimap.Some multimap implementations allow duplicate key-value pairs, in which case
putalways 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.- Parameters:
key- - map keyvalue- - map value- Returns:
trueif the method increased the size of the multimap, orfalseif the multimap already contained the key-value pair and doesn't allow duplicates
-
removeAsync
Removes a single key-value pair with the keykeyand the valuevaluefrom this multimap, if such exists. If multiple key-value pairs in the multimap fit this description, which one is removed is unspecified.- Parameters:
key- - map keyvalue- - map value- Returns:
trueif the multimap changed
-
putAllAsync
Stores a key-value pair in this multimap for each ofvalues, 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
valuesis empty.- Parameters:
key- - map keyvalues- - map values- Returns:
trueif the multimap changed
-
replaceValuesAsync
Stores a collection of values with the same key, replacing any existing values for that key.If
valuesis empty, this is equivalent toremoveAllAsync(Object).- Parameters:
key- - map keyvalues- - map values- Returns:
- the collection of replaced values, or an empty collection if no values were previously associated with the key. The collection may be modifiable, but updating it will have no effect on the multimap.
-
removeAllAsync
Removes all values associated with the keykey.Once this method returns,
keywill not be mapped to any values.- Parameters:
key- - map key- Returns:
- the values that were removed (possibly empty). The returned collection may be modifiable, but updating it will have no effect on the multimap.
-
getAllAsync
-
keySizeAsync
Returns the number of key-value pairs in this multimap.- Returns:
- keys amount
-
fastRemoveAsync
Removeskeysfrom map by one operation Works faster thanRMultimap.removebut not returning the value associated withkey- Parameters:
keys- - map keys- Returns:
- the number of keys that were removed from the hash, not including specified but non existing keys
-
fastRemoveValueAsync
Removesvaluesfrom map by one operation- Parameters:
values- map values- Returns:
- the number of values that were removed from the map
-
readAllKeySetAsync
Read all keys at once- Returns:
- keys
-