public class AsyncMapWrapper<K,V> extends Object implements AsyncMap<K,V>, LambdaLogger
| Constructor and Description |
|---|
AsyncMapWrapper(String name,
Map<K,V> map,
RpcExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(Handler<AsyncResult<Void>> handler)
Clear all entries in the map
|
void |
get(K k,
Handler<AsyncResult<V>> handler)
Get a value from the map, asynchronously.
|
Logger |
log() |
void |
put(K k,
V v,
Handler<AsyncResult<Void>> handler)
Put a value in the map, asynchronously.
|
void |
put(K k,
V v,
long timeout,
Handler<AsyncResult<Void>> handler)
Like
AsyncMap.put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but specifying a timeout. |
void |
putIfAbsent(K k,
V v,
Handler<AsyncResult<V>> handler)
Put the entry only if there is no entry with the key already present.
|
void |
putIfAbsent(K k,
V v,
long timeout,
Handler<AsyncResult<V>> handler)
Link
AsyncMap.putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>) but specifying a timeout. |
void |
remove(K k,
Handler<AsyncResult<V>> handler)
Remove a value from the map, asynchronously.
|
void |
removeIfPresent(K k,
V v,
Handler<AsyncResult<Boolean>> handler)
Remove a value from the map, only if entry already exists with same value.
|
void |
replace(K k,
V v,
Handler<AsyncResult<V>> handler)
Replace the entry only if it is currently mapped to some value
|
void |
replaceIfPresent(K k,
V oldValue,
V newValue,
Handler<AsyncResult<Boolean>> handler)
Replace the entry only if it is currently mapped to a specific value
|
void |
size(Handler<AsyncResult<Integer>> handler)
Provide the number of entries in the map
|
public AsyncMapWrapper(String name, Map<K,V> map, RpcExecutorService executorService)
public void get(K k, Handler<AsyncResult<V>> handler)
AsyncMappublic void put(K k, V v, Handler<AsyncResult<Void>> handler)
AsyncMappublic void put(K k, V v, long timeout, Handler<AsyncResult<Void>> handler)
AsyncMapAsyncMap.put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but specifying a timeout. If the value cannot be put within the timeout a
failure will be passed to the handlerpublic void putIfAbsent(K k, V v, Handler<AsyncResult<V>> handler)
AsyncMapputIfAbsent in interface AsyncMap<K,V>k - the keyv - the valuehandler - the handlerpublic void putIfAbsent(K k, V v, long timeout, Handler<AsyncResult<V>> handler)
AsyncMapAsyncMap.putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>) but specifying a timeout. If the value cannot be put within the timeout a
failure will be passed to the handlerputIfAbsent in interface AsyncMap<K,V>k - the keyv - the valuetimeout - The time to live (in ms) for the entryhandler - the handlerpublic void remove(K k, Handler<AsyncResult<V>> handler)
AsyncMappublic void removeIfPresent(K k, V v, Handler<AsyncResult<Boolean>> handler)
AsyncMapremoveIfPresent in interface AsyncMap<K,V>k - the keyv - the valuehandler - - this will be called some time later to signify the value has been removedpublic void replace(K k, V v, Handler<AsyncResult<V>> handler)
AsyncMappublic void replaceIfPresent(K k, V oldValue, V newValue, Handler<AsyncResult<Boolean>> handler)
AsyncMapreplaceIfPresent in interface AsyncMap<K,V>k - the keyoldValue - the existing valuenewValue - the new valuehandler - the result handlerpublic void clear(Handler<AsyncResult<Void>> handler)
AsyncMappublic void size(Handler<AsyncResult<Integer>> handler)
AsyncMappublic Logger log()
log in interface LambdaLoggerCopyright © 2015. All rights reserved.