An asynchronous map.
Constructor and description |
---|
AsyncMap
(java.lang.Object delegate) |
Type | Name and description |
---|---|
void |
clear(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler) Clear all entries in the map |
void |
get(K k, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> resultHandler) Get a value from the map, asynchronously. |
java.lang.Object |
getDelegate() |
void |
put(K k, V v, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> completionHandler) Put a value in the map, asynchronously. |
void |
put(K k, V v, long ttl, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> completionHandler) Like AsyncMap.put but specifying a timeout. |
void |
putIfAbsent(K k, V v, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> completionHandler) Put the entry only if there is no entry with the key already present. |
void |
putIfAbsent(K k, V v, long ttl, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> completionHandler) Link AsyncMap.putIfAbsent but specifying a timeout. |
void |
remove(K k, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> resultHandler) Remove a value from the map, asynchronously. |
void |
removeIfPresent(K k, V v, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Boolean>> resultHandler) Remove a value from the map, only if entry already exists with same value. |
void |
replace(K k, V v, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> resultHandler) Replace the entry only if it is currently mapped to some value |
void |
replaceIfPresent(K k, V oldValue, V newValue, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Boolean>> resultHandler) Replace the entry only if it is currently mapped to a specific value |
void |
size(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Integer>> resultHandler) Provide the number of entries in the map |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Clear all entries in the map
resultHandler
- called on completionGet a value from the map, asynchronously.
k
- the keyresultHandler
- - this will be called some time later with the async result.Put a value in the map, asynchronously.
k
- the keyv
- the valuecompletionHandler
- - this will be called some time later to signify the value has been putLike AsyncMap.put but specifying a timeout. If the value cannot be put within the timeout a failure will be passed to the handler
k
- the keyv
- the valuettl
- The time to live (in ms) for the entrycompletionHandler
- the handlerPut 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.
k
- the keyv
- the valuecompletionHandler
- the handlerLink AsyncMap.putIfAbsent but specifying a timeout. If the value cannot be put within the timeout a failure will be passed to the handler
k
- the keyv
- the valuettl
- The time to live (in ms) for the entrycompletionHandler
- the handlerRemove a value from the map, asynchronously.
k
- the keyresultHandler
- - this will be called some time later to signify the value has been removedRemove a value from the map, only if entry already exists with same value.
k
- the keyv
- the valueresultHandler
- - this will be called some time later to signify the value has been removedReplace the entry only if it is currently mapped to some value
k
- the keyv
- the new valueresultHandler
- the result handler will be passed the previous valueReplace the entry only if it is currently mapped to a specific value
k
- the keyoldValue
- the existing valuenewValue
- the new valueresultHandler
- the result handlerProvide the number of entries in the map
resultHandler
- handler which will receive the number of entries