K - key typeV - value typepublic class UnmodifiableAsyncConsistentMap<K,V> extends DelegatingAsyncConsistentMap<K,V>
AsyncConsistentMap.
Any attempt to update the map through this instance will cause the
operation to be completed with an UnsupportedOperationException.
DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERTATION_TIMEOUT_MILLIS| Constructor and Description |
|---|
UnmodifiableAsyncConsistentMap(AsyncConsistentMap<K,V> backingMap) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
clear()
Removes all of the mappings from this map (optional operation).
|
CompletableFuture<Versioned<V>> |
computeIf(K key,
Predicate<? super V> condition,
BiFunction<? super K,? super V,? extends V> remappingFunction)
If the value for the specified key satisfies a condition, attempts to compute a new
mapping given the key and its current mapped value.
|
CompletableFuture<Versioned<V>> |
put(K key,
V value)
Associates the specified value with the specified key in this map (optional operation).
|
CompletableFuture<Versioned<V>> |
putAndGet(K key,
V value)
Associates the specified value with the specified key in this map (optional operation).
|
CompletableFuture<Versioned<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 behaves as a get
returning the existing mapping without making any changes.
|
CompletableFuture<Versioned<V>> |
remove(K key)
Removes the mapping for a key from this map if it is present (optional operation).
|
CompletableFuture<Boolean> |
remove(K key,
long version)
Removes the entry for the specified key only if its current
version in the map is equal to the specified version.
|
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,
long oldVersion,
V newValue)
Replaces the entry for the specified key only if it is currently mapped to the
specified version.
|
CompletableFuture<Versioned<V>> |
replace(K key,
V value)
Replaces the entry for the specified key only if there is any value
which associated with specified key.
|
CompletableFuture<Boolean> |
replace(K key,
V oldValue,
V newValue)
Replaces the entry for the specified key only if currently mapped
to the specified value.
|
addListener, addStatusChangeListener, begin, commit, containsKey, containsValue, entrySet, equals, get, getOrDefault, hashCode, keySet, prepare, prepareAndCommit, removeListener, removeStatusChangeListener, rollback, size, statusChangeListeners, toString, valuesapplicationId, destroy, name, primitiveTypeclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddListener, asConsistentMap, asConsistentMap, compute, computeIfAbsent, computeIfPresent, destroy, isEmpty, primitiveTypeapplicationId, namepublic UnmodifiableAsyncConsistentMap(AsyncConsistentMap<K,V> backingMap)
public CompletableFuture<Versioned<V>> computeIf(K key, Predicate<? super V> condition, BiFunction<? super K,? super V,? extends V> remappingFunction)
AsyncConsistentMapcomputeIf in interface AsyncConsistentMap<K,V>computeIf in class DelegatingAsyncConsistentMap<K,V>key - key with which the specified value is to be associatedcondition - condition that should evaluate to true for the computation to proceedremappingFunction - the function to compute a valuepublic CompletableFuture<Versioned<V>> put(K key, V value)
AsyncConsistentMapput in interface AsyncConsistentMap<K,V>put in class DelegatingAsyncConsistentMap<K,V>key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic CompletableFuture<Versioned<V>> putAndGet(K key, V value)
AsyncConsistentMapputAndGet in interface AsyncConsistentMap<K,V>putAndGet in class DelegatingAsyncConsistentMap<K,V>key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic CompletableFuture<Versioned<V>> remove(K key)
AsyncConsistentMapremove in interface AsyncConsistentMap<K,V>remove in class DelegatingAsyncConsistentMap<K,V>key - key whose value is to be removed from the mappublic CompletableFuture<Void> clear()
AsyncConsistentMapclear in interface AsyncConsistentMap<K,V>clear in class DelegatingAsyncConsistentMap<K,V>public CompletableFuture<Versioned<V>> putIfAbsent(K key, V value)
AsyncConsistentMapputIfAbsent in interface AsyncConsistentMap<K,V>putIfAbsent in class DelegatingAsyncConsistentMap<K,V>key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic CompletableFuture<Boolean> remove(K key, V value)
AsyncConsistentMapremove in interface AsyncConsistentMap<K,V>remove in class DelegatingAsyncConsistentMap<K,V>key - key with which the specified value is associatedvalue - value expected to be associated with the specified keypublic CompletableFuture<Boolean> remove(K key, long version)
AsyncConsistentMapremove in interface AsyncConsistentMap<K,V>remove in class DelegatingAsyncConsistentMap<K,V>key - key with which the specified version is associatedversion - version expected to be associated with the specified keypublic CompletableFuture<Versioned<V>> replace(K key, V value)
AsyncConsistentMapreplace in interface AsyncConsistentMap<K,V>replace in class DelegatingAsyncConsistentMap<K,V>key - key with which the specified value is associatedvalue - value expected to be associated with the specified keypublic CompletableFuture<Boolean> replace(K key, V oldValue, V newValue)
AsyncConsistentMapreplace in interface AsyncConsistentMap<K,V>replace in class DelegatingAsyncConsistentMap<K,V>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 keypublic CompletableFuture<Boolean> replace(K key, long oldVersion, V newValue)
AsyncConsistentMapreplace in interface AsyncConsistentMap<K,V>replace in class DelegatingAsyncConsistentMap<K,V>key - key key with which the specified value is associatedoldVersion - version expected to be associated with the specified keynewValue - value to be associated with the specified key