Class AsyncMap<K,V>
- java.lang.Object
-
- io.vertx.rxjava3.core.shareddata.AsyncMap<K,V>
-
public class AsyncMap<K,V> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<AsyncMap>
__TYPE_ARG
io.vertx.lang.rx.TypeArg<K>
__typeArg_0
io.vertx.lang.rx.TypeArg<V>
__typeArg_1
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Completable
clear()
Clear all entries in the mapboolean
equals(Object o)
Maybe<V>
get(K k)
Get a value from the map, asynchronously.AsyncMap
getDelegate()
int
hashCode()
Single<Set<K>>
keys()
Get the keys of the map, asynchronously.static <K,V>
AsyncMap<K,V>newInstance(AsyncMap arg)
static <K,V>
AsyncMap<K,V>newInstance(AsyncMap arg, io.vertx.lang.rx.TypeArg<K> __typeArg_K, io.vertx.lang.rx.TypeArg<V> __typeArg_V)
Completable
put(K k, V v)
Put a value in the map, asynchronously.Completable
put(K k, V v, long ttl)
Likeput(K, V)
but specifying a time to live for the entry.Maybe<V>
putIfAbsent(K k, V v)
Put the entry only if there is no entry with the key already present.Maybe<V>
putIfAbsent(K k, V v, long ttl)
LinkputIfAbsent(K, V)
but specifying a time to live for the entry.Maybe<V>
remove(K k)
Remove a value from the map, asynchronously.Single<Boolean>
removeIfPresent(K k, V v)
Remove a value from the map, only if entry already exists with same value.Maybe<V>
replace(K k, V v)
Replace the entry only if it is currently mapped to some valueMaybe<V>
replace(K k, V v, long ttl)
Replace the entry only if it is currently mapped to some valueSingle<Boolean>
replaceIfPresent(K k, V oldValue, V newValue)
Replace the entry only if it is currently mapped to a specific valueSingle<Boolean>
replaceIfPresent(K k, V oldValue, V newValue, long ttl)
Replace the entry only if it is currently mapped to a specific valueCompletable
rxClear()
Clear all entries in the mapMaybe<V>
rxGet(K k)
Get a value from the map, asynchronously.Single<Set<K>>
rxKeys()
Get the keys of the map, asynchronously.Completable
rxPut(K k, V v)
Put a value in the map, asynchronously.Completable
rxPut(K k, V v, long ttl)
Likeput(K, V)
but specifying a time to live for the entry.Maybe<V>
rxPutIfAbsent(K k, V v)
Put the entry only if there is no entry with the key already present.Maybe<V>
rxPutIfAbsent(K k, V v, long ttl)
LinkputIfAbsent(K, V)
but specifying a time to live for the entry.Maybe<V>
rxRemove(K k)
Remove a value from the map, asynchronously.Single<Boolean>
rxRemoveIfPresent(K k, V v)
Remove a value from the map, only if entry already exists with same value.Maybe<V>
rxReplace(K k, V v)
Replace the entry only if it is currently mapped to some valueMaybe<V>
rxReplace(K k, V v, long ttl)
Replace the entry only if it is currently mapped to some valueSingle<Boolean>
rxReplaceIfPresent(K k, V oldValue, V newValue)
Replace the entry only if it is currently mapped to a specific valueSingle<Boolean>
rxReplaceIfPresent(K k, V oldValue, V newValue, long ttl)
Replace the entry only if it is currently mapped to a specific valueSingle<Integer>
rxSize()
Provide the number of entries in the mapSingle<List<V>>
rxValues()
Get the values of the map, asynchronously.Single<Integer>
size()
Provide the number of entries in the mapString
toString()
Single<List<V>>
values()
Get the values of the map, asynchronously.
-
-
-
Method Detail
-
getDelegate
public AsyncMap getDelegate()
-
get
public Maybe<V> get(K k)
Get a value from the map, asynchronously.- Parameters:
k
- the key- Returns:
- a future notified some time later with the async result.
-
rxGet
public Maybe<V> rxGet(K k)
Get a value from the map, asynchronously.- Parameters:
k
- the key- Returns:
- a future notified some time later with the async result.
-
put
public Completable put(K k, V v)
Put a value in the map, asynchronously.- Parameters:
k
- the keyv
- the value- Returns:
- a future notified some time later with the async result.
-
rxPut
public Completable rxPut(K k, V v)
Put a value in the map, asynchronously.- Parameters:
k
- the keyv
- the value- Returns:
- a future notified some time later with the async result.
-
put
public Completable put(K k, V v, long ttl)
Likeput(K, V)
but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.- Parameters:
k
- the keyv
- the valuettl
- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the async result.
-
rxPut
public Completable rxPut(K k, V v, long ttl)
Likeput(K, V)
but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.- Parameters:
k
- the keyv
- the valuettl
- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the async result.
-
putIfAbsent
public Maybe<V> putIfAbsent(K k, V v)
Put the entry only if there is no entry with the key already present. If key already present then the existing value will be returned to the handler, otherwise null.- Parameters:
k
- the keyv
- the value- Returns:
- a future notified some time later with the async result.
-
rxPutIfAbsent
public Maybe<V> rxPutIfAbsent(K k, V v)
Put the entry only if there is no entry with the key already present. If key already present then the existing value will be returned to the handler, otherwise null.- Parameters:
k
- the keyv
- the value- Returns:
- a future notified some time later with the async result.
-
putIfAbsent
public Maybe<V> putIfAbsent(K k, V v, long ttl)
LinkputIfAbsent(K, V)
but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.- Parameters:
k
- the keyv
- the valuettl
- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the async result.
-
rxPutIfAbsent
public Maybe<V> rxPutIfAbsent(K k, V v, long ttl)
LinkputIfAbsent(K, V)
but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.- Parameters:
k
- the keyv
- the valuettl
- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the async result.
-
remove
public Maybe<V> remove(K k)
Remove a value from the map, asynchronously.- Parameters:
k
- the key- Returns:
- a future notified some time later with the async result.
-
rxRemove
public Maybe<V> rxRemove(K k)
Remove a value from the map, asynchronously.- Parameters:
k
- the key- Returns:
- a future notified some time later with the async result.
-
removeIfPresent
public Single<Boolean> removeIfPresent(K k, V v)
Remove a value from the map, only if entry already exists with same value.- Parameters:
k
- the keyv
- the value- Returns:
- a future notified some time later with the async result.
-
rxRemoveIfPresent
public Single<Boolean> rxRemoveIfPresent(K k, V v)
Remove a value from the map, only if entry already exists with same value.- Parameters:
k
- the keyv
- the value- Returns:
- a future notified some time later with the async result.
-
replace
public Maybe<V> replace(K k, V v)
Replace the entry only if it is currently mapped to some value- Parameters:
k
- the keyv
- the new value- Returns:
- a future notified some time later with the async result.
-
rxReplace
public Maybe<V> rxReplace(K k, V v)
Replace the entry only if it is currently mapped to some value- Parameters:
k
- the keyv
- the new value- Returns:
- a future notified some time later with the async result.
-
replace
public Maybe<V> replace(K k, V v, long ttl)
Replace the entry only if it is currently mapped to some value- Parameters:
k
- the keyv
- the new valuettl
- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the previous value
-
rxReplace
public Maybe<V> rxReplace(K k, V v, long ttl)
Replace the entry only if it is currently mapped to some value- Parameters:
k
- the keyv
- the new valuettl
- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the previous value
-
replaceIfPresent
public Single<Boolean> replaceIfPresent(K k, V oldValue, V newValue)
Replace the entry only if it is currently mapped to a specific value- Parameters:
k
- the keyoldValue
- the existing valuenewValue
- the new value- Returns:
- a future notified some time later with the async result.
-
rxReplaceIfPresent
public Single<Boolean> rxReplaceIfPresent(K k, V oldValue, V newValue)
Replace the entry only if it is currently mapped to a specific value- Parameters:
k
- the keyoldValue
- the existing valuenewValue
- the new value- Returns:
- a future notified some time later with the async result.
-
replaceIfPresent
public Single<Boolean> replaceIfPresent(K k, V oldValue, V newValue, long ttl)
Replace the entry only if it is currently mapped to a specific value- Parameters:
k
- the keyoldValue
- the existing valuenewValue
- the new valuettl
- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the async result.
-
rxReplaceIfPresent
public Single<Boolean> rxReplaceIfPresent(K k, V oldValue, V newValue, long ttl)
Replace the entry only if it is currently mapped to a specific value- Parameters:
k
- the keyoldValue
- the existing valuenewValue
- the new valuettl
- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the async result.
-
clear
public Completable clear()
Clear all entries in the map- Returns:
- a future notified some time later with the async result.
-
rxClear
public Completable rxClear()
Clear all entries in the map- Returns:
- a future notified some time later with the async result.
-
size
public Single<Integer> size()
Provide the number of entries in the map- Returns:
- a future notified some time later with the async result.
-
rxSize
public Single<Integer> rxSize()
Provide the number of entries in the map- Returns:
- a future notified some time later with the async result.
-
keys
public Single<Set<K>> keys()
Get the keys of the map, asynchronously.Use this method with care as the map may contain a large number of keys, which may not fit entirely in memory of a single node. In this case, the invocation will result in an
OutOfMemoryError
.- Returns:
- a future notified some time later with the async result.
-
rxKeys
public Single<Set<K>> rxKeys()
Get the keys of the map, asynchronously.Use this method with care as the map may contain a large number of keys, which may not fit entirely in memory of a single node. In this case, the invocation will result in an
OutOfMemoryError
.- Returns:
- a future notified some time later with the async result.
-
values
public Single<List<V>> values()
Get the values of the map, asynchronously.Use this method with care as the map may contain a large number of values, which may not fit entirely in memory of a single node. In this case, the invocation will result in an
OutOfMemoryError
.- Returns:
- a future notified some time later with the async result.
-
rxValues
public Single<List<V>> rxValues()
Get the values of the map, asynchronously.Use this method with care as the map may contain a large number of values, which may not fit entirely in memory of a single node. In this case, the invocation will result in an
OutOfMemoryError
.- Returns:
- a future notified some time later with the async result.
-
-