public interface AsyncTransactionalMap<K,V> extends AsyncPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
containsKey(K key)
Returns true if this map contains a mapping for the specified key.
|
CompletableFuture<V> |
get(K key)
Returns the value to which the specified key is mapped, or null if this
map contains no mapping for the key.
|
CompletableFuture<V> |
put(K key,
V value)
Associates the specified value with the specified key in this map (optional operation).
|
CompletableFuture<V> |
putIfAbsent(K key,
V value)
If the specified key is not already associated with a value
associates it with the given value and returns null, else returns the current value.
|
CompletableFuture<V> |
remove(K key)
Removes the mapping for a key from this map if it is present (optional operation).
|
CompletableFuture<Boolean> |
remove(K key,
V value)
Removes the entry for the specified key only if it is currently
mapped to the specified value.
|
CompletableFuture<Boolean> |
replace(K key,
V oldValue,
V newValue)
Replaces the entry for the specified key only if currently mapped
to the specified value.
|
default TransactionalMap<K,V> |
sync()
Returns a synchronous wrapper around the asynchronous primitive.
|
TransactionalMap<K,V> |
sync(Duration operationTimeout)
Returns a synchronous wrapper around the asynchronous primitive.
|
close, deleteaddStateChangeListener, name, protocol, removeStateChangeListener, typeCompletableFuture<V> get(K key)
key - the key whose associated value is to be returnedCompletableFuture<Boolean> containsKey(K key)
key - key whose presence in this map to be testedCompletableFuture<V> put(K key, V value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keyCompletableFuture<V> remove(K key)
key - key whose value is to be removed from the mapCompletableFuture<V> putIfAbsent(K key, V value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keyCompletableFuture<Boolean> remove(K key, V value)
key - key with which the specified value is associatedvalue - value expected to be associated with the specified keyCompletableFuture<Boolean> replace(K key, V oldValue, V newValue)
key - key with which the specified value is associatedoldValue - value expected to be associated with the specified keynewValue - value to be associated with the specified keydefault TransactionalMap<K,V> sync()
AsyncPrimitivesync in interface AsyncPrimitiveTransactionalMap<K,V> sync(Duration operationTimeout)
AsyncPrimitivesync in interface AsyncPrimitiveoperationTimeout - the synchronous operation timeoutCopyright © 2013–2018. All rights reserved.