Class AsyncMap<K,V>
- java.lang.Object
-
- io.vertx.mutiny.core.shareddata.AsyncMap<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<AsyncMap>__TYPE_ARGTypeArg<K>__typeArg_0TypeArg<V>__typeArg_1
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>clear()Clear all entries in the mapVoidclearAndAwait()Blocking variant ofclear().booleanequals(Object o)io.smallrye.mutiny.Uni<V>get(K k)Get a value from the map, asynchronously.VgetAndAwait(K k)Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#get(K).io.vertx.core.shareddata.AsyncMapgetDelegate()inthashCode()static <K,V>
AsyncMap<K,V>newInstance(io.vertx.core.shareddata.AsyncMap arg)static <K,V>
AsyncMap<K,V>newInstance(io.vertx.core.shareddata.AsyncMap arg, TypeArg<K> __typeArg_K, TypeArg<V> __typeArg_V)io.smallrye.mutiny.Uni<Void>put(K k, V v)Put a value in the map, asynchronously.io.smallrye.mutiny.Uni<Void>put(K k, V v, long ttl)Likeput(K, V)but specifying a time to live for the entry.VoidputAndAwait(K k, V v)Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#put(K,V).VoidputAndAwait(K k, V v, long ttl)Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#put(K,V,long).io.smallrye.mutiny.Uni<V>putIfAbsent(K k, V v)Put the entry only if there is no entry with the key already present.io.smallrye.mutiny.Uni<V>putIfAbsent(K k, V v, long ttl)LinkputIfAbsent(K, V)but specifying a time to live for the entry.VputIfAbsentAndAwait(K k, V v)Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#putIfAbsent(K,V).VputIfAbsentAndAwait(K k, V v, long ttl)Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#putIfAbsent(K,V,long).io.smallrye.mutiny.Uni<V>remove(K k)Remove a value from the map, asynchronously.VremoveAndAwait(K k)Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#remove(K).io.smallrye.mutiny.Uni<Boolean>removeIfPresent(K k, V v)Remove a value from the map, only if entry already exists with same value.BooleanremoveIfPresentAndAwait(K k, V v)Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#removeIfPresent(K,V).io.smallrye.mutiny.Uni<V>replace(K k, V v)Replace the entry only if it is currently mapped to some valueVreplaceAndAwait(K k, V v)Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#replace(K,V).io.smallrye.mutiny.Uni<Boolean>replaceIfPresent(K k, V oldValue, V newValue)Replace the entry only if it is currently mapped to a specific valueBooleanreplaceIfPresentAndAwait(K k, V oldValue, V newValue)Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#replaceIfPresent(K,V,V).io.smallrye.mutiny.Uni<Integer>size()Provide the number of entries in the mapIntegersizeAndAwait()Blocking variant ofsize().StringtoString()
-
-
-
Method Detail
-
getDelegate
public io.vertx.core.shareddata.AsyncMap getDelegate()
-
get
public io.smallrye.mutiny.Uni<V> get(K k)
Get a value from the map, asynchronously.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
k- the key- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
getAndAwait
public V getAndAwait(K k)
Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#get(K).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
k- the key- Returns:
- the V instance produced by the operation
-
put
public io.smallrye.mutiny.Uni<Void> put(K k, V v)
Put a value in the map, asynchronously.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
k- the keyv- the value- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
putAndAwait
public Void putAndAwait(K k, V v)
Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#put(K,V).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
k- the keyv- the value- Returns:
- the Void instance produced by the operation
-
put
public io.smallrye.mutiny.Uni<Void> 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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
k- the keyv- the valuettl- The time to live (in ms) for the entry- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
putAndAwait
public Void putAndAwait(K k, V v, long ttl)
Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#put(K,V,long).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
k- the keyv- the valuettl- The time to live (in ms) for the entry- Returns:
- the Void instance produced by the operation
-
putIfAbsent
public io.smallrye.mutiny.Uni<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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
k- the keyv- the value- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
putIfAbsentAndAwait
public V putIfAbsentAndAwait(K k, V v)
Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#putIfAbsent(K,V).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
k- the keyv- the value- Returns:
- the V instance produced by the operation
-
putIfAbsent
public io.smallrye.mutiny.Uni<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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
k- the keyv- the valuettl- The time to live (in ms) for the entry- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
putIfAbsentAndAwait
public V putIfAbsentAndAwait(K k, V v, long ttl)
Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#putIfAbsent(K,V,long).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
k- the keyv- the valuettl- The time to live (in ms) for the entry- Returns:
- the V instance produced by the operation
-
remove
public io.smallrye.mutiny.Uni<V> remove(K k)
Remove a value from the map, asynchronously.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
k- the key- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
removeAndAwait
public V removeAndAwait(K k)
Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#remove(K).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
k- the key- Returns:
- the V instance produced by the operation
-
removeIfPresent
public io.smallrye.mutiny.Uni<Boolean> removeIfPresent(K k, V v)
Remove a value from the map, only if entry already exists with same value.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
k- the keyv- the value- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
removeIfPresentAndAwait
public Boolean removeIfPresentAndAwait(K k, V v)
Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#removeIfPresent(K,V).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
k- the keyv- the value- Returns:
- the Boolean instance produced by the operation
-
replace
public io.smallrye.mutiny.Uni<V> replace(K k, V v)
Replace the entry only if it is currently mapped to some valueUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
k- the keyv- the new value- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
replaceAndAwait
public V replaceAndAwait(K k, V v)
Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#replace(K,V).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
k- the keyv- the new value- Returns:
- the V instance produced by the operation
-
replaceIfPresent
public io.smallrye.mutiny.Uni<Boolean> replaceIfPresent(K k, V oldValue, V newValue)
Replace the entry only if it is currently mapped to a specific valueUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
k- the keyoldValue- the existing valuenewValue- the new value- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
replaceIfPresentAndAwait
public Boolean replaceIfPresentAndAwait(K k, V oldValue, V newValue)
Blocking variant ofio.vertx.mutiny.core.shareddata.AsyncMap#replaceIfPresent(K,V,V).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
k- the keyoldValue- the existing valuenewValue- the new value- Returns:
- the Boolean instance produced by the operation
-
clear
public io.smallrye.mutiny.Uni<Void> clear()
Clear all entries in the mapUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
clearAndAwait
public Void clearAndAwait()
Blocking variant ofclear().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation
-
size
public io.smallrye.mutiny.Uni<Integer> size()
Provide the number of entries in the mapUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
sizeAndAwait
public Integer sizeAndAwait()
Blocking variant ofsize().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Integer instance produced by the operation
-
newInstance
public static <K,V> AsyncMap<K,V> newInstance(io.vertx.core.shareddata.AsyncMap arg)
-
-