public interface AsyncMap<K,V>
Modifier and Type | Method and Description |
---|---|
void |
clear(Handler<AsyncResult<Void>> resultHandler)
Clear all entries in the map
|
void |
get(K k,
Handler<AsyncResult<V>> resultHandler)
Get a value from the map, asynchronously.
|
void |
put(K k,
V v,
Handler<AsyncResult<Void>> completionHandler)
Put a value in the map, asynchronously.
|
void |
put(K k,
V v,
long ttl,
Handler<AsyncResult<Void>> completionHandler)
Like
put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but specifying a time to live for the entry. |
void |
putIfAbsent(K k,
V v,
Handler<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,
Handler<AsyncResult<V>> completionHandler)
Link
putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>) but specifying a time to live for the entry. |
void |
remove(K k,
Handler<AsyncResult<V>> resultHandler)
Remove a value from the map, asynchronously.
|
void |
removeIfPresent(K k,
V v,
Handler<AsyncResult<Boolean>> resultHandler)
Remove a value from the map, only if entry already exists with same value.
|
void |
replace(K k,
V v,
Handler<AsyncResult<V>> resultHandler)
Replace the entry only if it is currently mapped to some value
|
void |
replaceIfPresent(K k,
V oldValue,
V newValue,
Handler<AsyncResult<Boolean>> resultHandler)
Replace the entry only if it is currently mapped to a specific value
|
void |
size(Handler<AsyncResult<Integer>> resultHandler)
Provide the number of entries in the map
|
void get(K k, Handler<AsyncResult<V>> resultHandler)
k
- the keyresultHandler
- - this will be called some time later with the async result.void put(K k, V v, Handler<AsyncResult<Void>> completionHandler)
k
- the keyv
- the valuecompletionHandler
- - this will be called some time later to signify the value has been putvoid put(K k, V v, long ttl, Handler<AsyncResult<Void>> completionHandler)
put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but specifying a time to live for the entry. Entry will expire and get evicted after the
ttl.k
- the keyv
- the valuettl
- The time to live (in ms) for the entrycompletionHandler
- the handlervoid putIfAbsent(K k, V v, Handler<AsyncResult<V>> completionHandler)
k
- the keyv
- the valuecompletionHandler
- the handlervoid putIfAbsent(K k, V v, long ttl, Handler<AsyncResult<V>> completionHandler)
putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>)
but specifying a time to live for the entry. Entry will expire and get evicted
after the ttl.k
- the keyv
- the valuettl
- The time to live (in ms) for the entrycompletionHandler
- the handlervoid remove(K k, Handler<AsyncResult<V>> resultHandler)
k
- the keyresultHandler
- - this will be called some time later to signify the value has been removedvoid removeIfPresent(K k, V v, Handler<AsyncResult<Boolean>> resultHandler)
k
- the keyv
- the valueresultHandler
- - this will be called some time later to signify the value has been removedvoid replace(K k, V v, Handler<AsyncResult<V>> resultHandler)
k
- the keyv
- the new valueresultHandler
- the result handler will be passed the previous valuevoid replaceIfPresent(K k, V oldValue, V newValue, Handler<AsyncResult<Boolean>> resultHandler)
k
- the keyoldValue
- the existing valuenewValue
- the new valueresultHandler
- the result handlervoid clear(Handler<AsyncResult<Void>> resultHandler)
resultHandler
- called on completionvoid size(Handler<AsyncResult<Integer>> resultHandler)
resultHandler
- handler which will receive the number of entriesCopyright © 2016. All rights reserved.