public class AsyncMap<K,V> extends Object
io.vertx.core.shareddata.AsyncMap original
non RX-ified interface using Vert.x codegen.Modifier and Type | Method and Description |
---|---|
void |
clear(Handler<AsyncResult<Void>> resultHandler)
Clear all entries in the map
|
rx.Observable<Void> |
clearObservable()
Clear all entries in the map
|
void |
get(K k,
Handler<AsyncResult<V>> resultHandler)
Get a value from the map, asynchronously.
|
Object |
getDelegate() |
rx.Observable<V> |
getObservable(K k)
Get a value from the map, asynchronously.
|
static <K,V> AsyncMap<K,V> |
newInstance(AsyncMap arg) |
void |
put(K k,
V v,
Handler<AsyncResult<Void>> completionHandler)
Put a value in the map, asynchronously.
|
void |
put(K k,
V v,
long timeout,
Handler<AsyncResult<Void>> completionHandler)
Like
AsyncMap but specifying a timeout. |
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 timeout,
Handler<AsyncResult<V>> completionHandler)
Link
AsyncMap but specifying a timeout. |
rx.Observable<V> |
putIfAbsentObservable(K k,
V v)
Put the entry only if there is no entry with the key already present.
|
rx.Observable<V> |
putIfAbsentObservable(K k,
V v,
long timeout)
Link
AsyncMap but specifying a timeout. |
rx.Observable<Void> |
putObservable(K k,
V v)
Put a value in the map, asynchronously.
|
rx.Observable<Void> |
putObservable(K k,
V v,
long timeout)
Like
AsyncMap but specifying a timeout. |
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.
|
rx.Observable<Boolean> |
removeIfPresentObservable(K k,
V v)
Remove a value from the map, only if entry already exists with same value.
|
rx.Observable<V> |
removeObservable(K k)
Remove a value from the map, asynchronously.
|
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
|
rx.Observable<Boolean> |
replaceIfPresentObservable(K k,
V oldValue,
V newValue)
Replace the entry only if it is currently mapped to a specific value
|
rx.Observable<V> |
replaceObservable(K k,
V v)
Replace the entry only if it is currently mapped to some value
|
void |
size(Handler<AsyncResult<Integer>> resultHandler)
Provide the number of entries in the map
|
rx.Observable<Integer> |
sizeObservable()
Provide the number of entries in the map
|
public AsyncMap(AsyncMap delegate)
public Object getDelegate()
public void get(K k, Handler<AsyncResult<V>> resultHandler)
k
- the keyresultHandler
- - this will be called some time later with the async result.public rx.Observable<V> getObservable(K k)
k
- the keypublic 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 putpublic rx.Observable<Void> putObservable(K k, V v)
k
- the keyv
- the valuepublic void put(K k, V v, long timeout, Handler<AsyncResult<Void>> completionHandler)
AsyncMap
but specifying a timeout. If the value cannot be put within the timeout a
failure will be passed to the handlerk
- the keyv
- the valuetimeout
- the timoeout, in mscompletionHandler
- the handlerpublic rx.Observable<Void> putObservable(K k, V v, long timeout)
AsyncMap
but specifying a timeout. If the value cannot be put within the timeout a
failure will be passed to the handlerk
- the keyv
- the valuetimeout
- the timoeout, in mspublic void putIfAbsent(K k, V v, Handler<AsyncResult<V>> completionHandler)
k
- the keyv
- the valuecompletionHandler
- the handlerpublic rx.Observable<V> putIfAbsentObservable(K k, V v)
k
- the keyv
- the valuepublic void putIfAbsent(K k, V v, long timeout, Handler<AsyncResult<V>> completionHandler)
AsyncMap
but specifying a timeout. If the value cannot be put within the timeout a
failure will be passed to the handlerk
- the keyv
- the valuetimeout
- the timeout, in mscompletionHandler
- the handlerpublic rx.Observable<V> putIfAbsentObservable(K k, V v, long timeout)
AsyncMap
but specifying a timeout. If the value cannot be put within the timeout a
failure will be passed to the handlerk
- the keyv
- the valuetimeout
- the timeout, in mspublic void remove(K k, Handler<AsyncResult<V>> resultHandler)
k
- the keyresultHandler
- - this will be called some time later to signify the value has been removedpublic rx.Observable<V> removeObservable(K k)
k
- the keypublic void 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 removedpublic rx.Observable<Boolean> removeIfPresentObservable(K k, V v)
k
- the keyv
- the valuepublic void replace(K k, V v, Handler<AsyncResult<V>> resultHandler)
k
- the keyv
- the new valueresultHandler
- the result handler will be passed the previous valuepublic rx.Observable<V> replaceObservable(K k, V v)
k
- the keyv
- the new valuepublic void replaceIfPresent(K k, V oldValue, V newValue, Handler<AsyncResult<Boolean>> resultHandler)
k
- the keyoldValue
- the existing valuenewValue
- the new valueresultHandler
- the result handlerpublic rx.Observable<Boolean> replaceIfPresentObservable(K k, V oldValue, V newValue)
k
- the keyoldValue
- the existing valuenewValue
- the new valuepublic void clear(Handler<AsyncResult<Void>> resultHandler)
resultHandler
- called on completionpublic rx.Observable<Void> clearObservable()
public void size(Handler<AsyncResult<Integer>> resultHandler)
resultHandler
- handler which will receive the number of entriespublic rx.Observable<Integer> sizeObservable()
Copyright © 2015. All Rights Reserved.