Class AsyncMap<K,V>
- All Implemented Interfaces:
MutinyDelegate
AsyncMap
does not allow null
to be used as a key or value.
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>
clear()
Clear all entries in the mapBlocking variant ofclear()
.void
Variant ofclear()
that ignores the result of the operation.boolean
io.smallrye.mutiny.Uni<V>
Get a value from the map, asynchronously.getAndAwait
(K k) Blocking variant ofget(K)
.void
getAndForget
(K k) Variant ofget(K)
that ignores the result of the operation.io.vertx.core.shareddata.AsyncMap
int
hashCode()
keys()
Get the keys of the map, asynchronously.Blocking variant ofkeys()
.void
Variant ofkeys()
that ignores the result of the operation.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 a value in the map, asynchronously.io.smallrye.mutiny.Uni<Void>
Likeput(K, V)
but specifying a time to live for the entry.putAndAwait
(K k, V v) Blocking variant ofput(K,V)
.putAndAwait
(K k, V v, long ttl) Blocking variant ofput(K,V,long)
.void
putAndForget
(K k, V v) Variant ofput(K,V)
that ignores the result of the operation.void
putAndForget
(K k, V v, long ttl) Variant ofput(K,V,long)
that ignores the result of the operation.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.putIfAbsentAndAwait
(K k, V v) Blocking variant ofputIfAbsent(K,V)
.putIfAbsentAndAwait
(K k, V v, long ttl) Blocking variant ofputIfAbsent(K,V,long)
.void
putIfAbsentAndForget
(K k, V v) Variant ofputIfAbsent(K,V)
that ignores the result of the operation.void
putIfAbsentAndForget
(K k, V v, long ttl) Variant ofputIfAbsent(K,V,long)
that ignores the result of the operation.io.smallrye.mutiny.Uni<V>
Remove a value from the map, asynchronously.removeAndAwait
(K k) Blocking variant ofremove(K)
.void
removeAndForget
(K k) Variant ofremove(K)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Boolean>
removeIfPresent
(K k, V v) Remove a value from the map, only if entry already exists with same value.removeIfPresentAndAwait
(K k, V v) Blocking variant ofremoveIfPresent(K,V)
.void
removeIfPresentAndForget
(K k, V v) Variant ofremoveIfPresent(K,V)
that ignores the result of the operation.io.smallrye.mutiny.Uni<V>
Replace the entry only if it is currently mapped to some valueio.smallrye.mutiny.Uni<V>
Replace the entry only if it is currently mapped to some valuereplaceAndAwait
(K k, V v) Blocking variant ofreplace(K,V)
.replaceAndAwait
(K k, V v, long ttl) Blocking variant ofreplace(K,V,long)
.void
replaceAndForget
(K k, V v) Variant ofreplace(K,V)
that ignores the result of the operation.void
replaceAndForget
(K k, V v, long ttl) Variant ofreplace(K,V,long)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Boolean>
replaceIfPresent
(K k, V oldValue, V newValue) Replace the entry only if it is currently mapped to a specific valueio.smallrye.mutiny.Uni<Boolean>
replaceIfPresent
(K k, V oldValue, V newValue, long ttl) Replace the entry only if it is currently mapped to a specific valuereplaceIfPresentAndAwait
(K k, V oldValue, V newValue) Blocking variant ofreplaceIfPresent(K,V,V)
.replaceIfPresentAndAwait
(K k, V oldValue, V newValue, long ttl) Blocking variant ofreplaceIfPresent(K,V,V,long)
.void
replaceIfPresentAndForget
(K k, V oldValue, V newValue) Variant ofreplaceIfPresent(K,V,V)
that ignores the result of the operation.void
replaceIfPresentAndForget
(K k, V oldValue, V newValue, long ttl) Variant ofreplaceIfPresent(K,V,V,long)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Integer>
size()
Provide the number of entries in the mapBlocking variant ofsize()
.void
Variant ofsize()
that ignores the result of the operation.toString()
values()
Get the values of the map, asynchronously.Blocking variant ofvalues()
.void
Variant ofvalues()
that ignores the result of the operation.
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
__typeArg_1
-
-
Constructor Details
-
AsyncMap
-
Method Details
-
getDelegate
public io.vertx.core.shareddata.AsyncMap getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
get
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getAndAwait
Blocking variant ofget(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.
-
getAndForget
Variant ofget(K)
that ignores the result of the operation.This method subscribes on the result of
get(K)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromget(K)
but you don't need to compose it with other operations.- Parameters:
k
- the key
-
put
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
putAndAwait
Blocking variant ofput(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.
-
putAndForget
Variant ofput(K,V)
that ignores the result of the operation.This method subscribes on the result of
put(K,V)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromput(K,V)
but you don't need to compose it with other operations.- Parameters:
k
- the keyv
- the value
-
put
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
putAndAwait
Blocking variant ofput(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.
-
putAndForget
Variant ofput(K,V,long)
that ignores the result of the operation.This method subscribes on the result of
put(K,V,long)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromput(K,V,long)
but you don't need to compose it with other operations.- Parameters:
k
- the keyv
- the valuettl
- The time to live (in ms) for the entry
-
putIfAbsent
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
putIfAbsentAndAwait
Blocking variant ofputIfAbsent(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.
-
putIfAbsentAndForget
Variant ofputIfAbsent(K,V)
that ignores the result of the operation.This method subscribes on the result of
putIfAbsent(K,V)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromputIfAbsent(K,V)
but you don't need to compose it with other operations.- Parameters:
k
- the keyv
- the value
-
putIfAbsent
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
putIfAbsentAndAwait
Blocking variant ofputIfAbsent(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.
-
putIfAbsentAndForget
Variant ofputIfAbsent(K,V,long)
that ignores the result of the operation.This method subscribes on the result of
putIfAbsent(K,V,long)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromputIfAbsent(K,V,long)
but you don't need to compose it with other operations.- Parameters:
k
- the keyv
- the valuettl
- The time to live (in ms) for the entry
-
remove
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
removeAndAwait
Blocking variant ofremove(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.
-
removeAndForget
Variant ofremove(K)
that ignores the result of the operation.This method subscribes on the result of
remove(K)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromremove(K)
but you don't need to compose it with other operations.- Parameters:
k
- the key
-
removeIfPresent
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
removeIfPresentAndAwait
Blocking variant ofremoveIfPresent(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.
-
removeIfPresentAndForget
Variant ofremoveIfPresent(K,V)
that ignores the result of the operation.This method subscribes on the result of
removeIfPresent(K,V)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromremoveIfPresent(K,V)
but you don't need to compose it with other operations.- Parameters:
k
- the keyv
- the value
-
replace
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
replaceAndAwait
Blocking variant ofreplace(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.
-
replaceAndForget
Variant ofreplace(K,V)
that ignores the result of the operation.This method subscribes on the result of
replace(K,V)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromreplace(K,V)
but you don't need to compose it with other operations.- Parameters:
k
- the keyv
- the new value
-
replace
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 valuettl
- The time to live (in ms) for the entry- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
replaceAndAwait
Blocking variant ofreplace(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 new valuettl
- The time to live (in ms) for the entry- Returns:
- the V instance produced by the operation.
-
replaceAndForget
Variant ofreplace(K,V,long)
that ignores the result of the operation.This method subscribes on the result of
replace(K,V,long)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromreplace(K,V,long)
but you don't need to compose it with other operations.- Parameters:
k
- the keyv
- the new valuettl
- The time to live (in ms) for the entry
-
replaceIfPresent
@CheckReturnValue 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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
replaceIfPresentAndAwait
Blocking variant ofreplaceIfPresent(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.
-
replaceIfPresentAndForget
Variant ofreplaceIfPresent(K,V,V)
that ignores the result of the operation.This method subscribes on the result of
replaceIfPresent(K,V,V)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromreplaceIfPresent(K,V,V)
but you don't need to compose it with other operations.- Parameters:
k
- the keyoldValue
- the existing valuenewValue
- the new value
-
replaceIfPresent
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> replaceIfPresent(K k, V oldValue, V newValue, long ttl) 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 valuettl
- The time to live (in ms) for the entry- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
replaceIfPresentAndAwait
Blocking variant ofreplaceIfPresent(K,V,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 keyoldValue
- the existing valuenewValue
- the new valuettl
- The time to live (in ms) for the entry- Returns:
- the Boolean instance produced by the operation.
-
replaceIfPresentAndForget
Variant ofreplaceIfPresent(K,V,V,long)
that ignores the result of the operation.This method subscribes on the result of
replaceIfPresent(K,V,V,long)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromreplaceIfPresent(K,V,V,long)
but you don't need to compose it with other operations.- Parameters:
k
- the keyoldValue
- the existing valuenewValue
- the new valuettl
- The time to live (in ms) for the entry
-
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
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.
-
clearAndForget
public void clearAndForget() -
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
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.
-
sizeAndForget
public void sizeAndForget() -
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
.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
keysAndAwait
Blocking variant ofkeys()
.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 Set
instance produced by the operation.
-
keysAndForget
public void keysAndForget() -
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
.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
valuesAndAwait
Blocking variant ofvalues()
.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 List
instance produced by the operation.
-
valuesAndForget
public void valuesAndForget()
-