public class DefaultAsyncMultiMap<K,V> extends AbstractResource<AsyncMultiMap<K,V>> implements AsyncMultiMap<K,V>
context, executor, serializer| Constructor and Description |
|---|
DefaultAsyncMultiMap(ResourceContext context) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> CompletableFuture<T> |
checkOpen(java.util.function.Supplier<CompletableFuture<T>> supplier)
If the map is closed, returning a failed CompletableFuture.
|
CompletableFuture<Void> |
clear()
Clears the map.
|
CompletableFuture<Void> |
close() |
CompletableFuture<Boolean> |
containsEntry(K key,
V value)
Checks whether the map contains an entry.
|
CompletableFuture<Boolean> |
containsKey(K key)
Checks whether the map contains a key.
|
CompletableFuture<Boolean> |
containsValue(V value)
Checks whether the map contains a value.
|
CompletableFuture<Set<Map.Entry<K,V>>> |
entrySet()
Gets a set of entries in the map.
|
CompletableFuture<Collection<V>> |
get(K key)
Gets a value from the map.
|
CompletableFuture<Collection<V>> |
getOrDefault(K key,
Collection<V> defaultValue)
Gets the value of a key or the given default value if the key does not exist.
|
CompletableFuture<Boolean> |
isEmpty()
Checks whether the map is empty.
|
CompletableFuture<Set<K>> |
keySet()
Gets a set of keys in the map.
|
CompletableFuture<AsyncMultiMap<K,V>> |
open() |
CompletableFuture<Collection<V>> |
put(K key,
V value)
Puts a value in the map.
|
CompletableFuture<Void> |
putAll(Map<? extends K,? extends Collection<V>> m)
Puts a map of values in the map.
|
CompletableFuture<Collection<V>> |
remove(K key)
Removes a value from the map.
|
CompletableFuture<Boolean> |
remove(K key,
V value)
Removes a key and value from the map.
|
CompletableFuture<Collection<V>> |
replace(K key,
Collection<V> value)
Replaces a key with the given value.
|
CompletableFuture<Boolean> |
replace(K key,
V oldValue,
V newValue)
Replaces a key and value in the map.
|
CompletableFuture<Void> |
replaceAll(java.util.function.BiFunction<? super K,? super Collection<V>,? extends Collection<V>> function)
Replaces values in the map.
|
CompletableFuture<Integer> |
size()
Gets the map size.
|
CompletableFuture<Collection<V>> |
values()
Gets a collection of values in the map.
|
addShutdownTask, addStartupTask, cluster, isClosed, isOpen, name, runShutdownTasks, runStartupTasksclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, createaddShutdownTask, addStartupTask, cluster, namepublic DefaultAsyncMultiMap(ResourceContext context)
protected <T> CompletableFuture<T> checkOpen(java.util.function.Supplier<CompletableFuture<T>> supplier)
T - The future result type.supplier - The supplier to call if the map is open.public CompletableFuture<Integer> size()
AsyncMultiMapProxysize in interface AsyncMultiMapProxy<K,V>public CompletableFuture<Boolean> isEmpty()
AsyncMultiMapProxyisEmpty in interface AsyncMultiMapProxy<K,V>public CompletableFuture<Boolean> containsKey(K key)
AsyncMultiMapProxycontainsKey in interface AsyncMultiMapProxy<K,V>key - The key to check.public CompletableFuture<Boolean> containsValue(V value)
AsyncMultiMapProxycontainsValue in interface AsyncMultiMapProxy<K,V>value - The value to check.public CompletableFuture<Boolean> containsEntry(K key, V value)
AsyncMultiMapProxycontainsEntry in interface AsyncMultiMapProxy<K,V>key - The key to check.value - The value to check.public CompletableFuture<Collection<V>> get(K key)
AsyncMultiMapProxyget in interface AsyncMultiMapProxy<K,V>key - The key to get.public CompletableFuture<Collection<V>> put(K key, V value)
AsyncMultiMapProxyput in interface AsyncMultiMapProxy<K,V>key - The key to set.value - The value to set.public CompletableFuture<Collection<V>> remove(K key)
AsyncMultiMapProxyremove in interface AsyncMultiMapProxy<K,V>key - The key to remove.public CompletableFuture<Boolean> remove(K key, V value)
AsyncMultiMapProxyremove in interface AsyncMultiMapProxy<K,V>key - The key to remove.value - The value to remove.public CompletableFuture<Void> putAll(Map<? extends K,? extends Collection<V>> m)
AsyncMultiMapProxyputAll in interface AsyncMultiMapProxy<K,V>m - The put to put.public CompletableFuture<Void> clear()
AsyncMultiMapProxyclear in interface AsyncMultiMapProxy<K,V>public CompletableFuture<Set<K>> keySet()
AsyncMultiMapProxykeySet in interface AsyncMultiMapProxy<K,V>public CompletableFuture<Collection<V>> values()
AsyncMultiMapProxyvalues in interface AsyncMultiMapProxy<K,V>public CompletableFuture<Set<Map.Entry<K,V>>> entrySet()
AsyncMultiMapProxyentrySet in interface AsyncMultiMapProxy<K,V>public CompletableFuture<Collection<V>> getOrDefault(K key, Collection<V> defaultValue)
AsyncMultiMapProxygetOrDefault in interface AsyncMultiMapProxy<K,V>key - The key to get.defaultValue - The default value to return if the key does not exist.public CompletableFuture<Void> replaceAll(java.util.function.BiFunction<? super K,? super Collection<V>,? extends Collection<V>> function)
AsyncMultiMapProxyreplaceAll in interface AsyncMultiMapProxy<K,V>function - The serializable function with which to replace values.public CompletableFuture<Boolean> replace(K key, V oldValue, V newValue)
AsyncMultiMapProxyreplace in interface AsyncMultiMapProxy<K,V>key - The key to replace.oldValue - The value to replace.newValue - The value with which to replace the given key and value.public CompletableFuture<Collection<V>> replace(K key, Collection<V> value)
AsyncMultiMapProxyreplace in interface AsyncMultiMapProxy<K,V>key - The key to replace.value - The value with which to replace the given key.public CompletableFuture<AsyncMultiMap<K,V>> open()
open in interface Managed<AsyncMultiMap<K,V>>public CompletableFuture<Void> close()
close in interface Managed<AsyncMultiMap<K,V>>Copyright © 2013-2015. All Rights Reserved.