Package org.redisson.api
Interface RMultimapRx<K,V>
- Type Parameters:
K- key typeV- value type
- All Superinterfaces:
RExpirableRx,RObjectRx
- All Known Subinterfaces:
RListMultimapCacheNativeRx<K,,V> RListMultimapCacheRx<K,,V> RListMultimapRx<K,,V> RSetMultimapCacheNativeRx<K,,V> RSetMultimapCacheRx<K,,V> RSetMultimapRx<K,V>
Base RxJava2 interface for Multimap object
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<Boolean> containsEntry(Object key, Object value) Returnstrueif this multimap contains at least one key-value pair with the keykeyand the valuevalue.io.reactivex.rxjava3.core.Single<Boolean> containsKey(Object key) Returnstrueif this multimap contains at least one key-value pair with the keykey.io.reactivex.rxjava3.core.Single<Boolean> containsValue(Object value) Returnstrueif this multimap contains at least one key-value pair with the valuevalue.io.reactivex.rxjava3.core.Single<Long> fastRemove(K... keys) Removeskeysfrom map by one operation Works faster thanRMultimap.removebut not returning the value associated withkeyio.reactivex.rxjava3.core.Single<Long> fastRemoveValue(V... values) Removesvaluesfrom map by one operationio.reactivex.rxjava3.core.Single<Void> fastReplaceValues(K key, Iterable<? extends V> values) Stores a collection of values with the same key, replacing any existing values for that key.io.reactivex.rxjava3.core.Single<Integer> keySize()Returns the number of key-value pairs in this multimap.io.reactivex.rxjava3.core.Single<Boolean> Stores a key-value pair in this multimap.io.reactivex.rxjava3.core.Single<Boolean> Stores a key-value pair in this multimap for each ofvalues, all using the same key,key.Read all keys at onceio.reactivex.rxjava3.core.Single<Boolean> Removes a single key-value pair with the keykeyand the valuevaluefrom this multimap, if such exists.io.reactivex.rxjava3.core.Single<Integer> size()Returns the number of key-value pairs in this multimap.Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RObjectRx
addListener, copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Method Details
-
size
io.reactivex.rxjava3.core.Single<Integer> size()Returns the number of key-value pairs in this multimap.- Returns:
- size of multimap
-
containsKey
Returnstrueif this multimap contains at least one key-value pair with the keykey.- Parameters:
key- - map key- Returns:
trueif contains a key
-
containsValue
Returnstrueif this multimap contains at least one key-value pair with the valuevalue.- Parameters:
value- - map value- Returns:
trueif contains a value
-
containsEntry
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
-
put
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
-
remove
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
-
putAll
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
-
keySize
io.reactivex.rxjava3.core.Single<Integer> keySize()Returns the number of key-value pairs in this multimap.- Returns:
- keys amount
-
fastReplaceValues
Stores a collection of values with the same key, replacing any existing values for that key. Is faster by not returning the values.- Parameters:
key- - map keyvalues- - map values
-
fastRemove
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
-
fastRemoveValue
Removesvaluesfrom map by one operation- Parameters:
values- map values- Returns:
- the number of values that were removed from the map
-
readAllKeySet
Read all keys at once- Returns:
- keys
-