public class RemoteMultimapCacheImpl<K,V> extends Object implements RemoteMultimapCache<K,V>
RemoteMultimapCache
Constructor and Description |
---|
RemoteMultimapCacheImpl(RemoteCacheManager rcm,
RemoteCache<K,Collection<V>> cache) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Boolean> |
containsEntry(K key,
V value)
Returns
Boolean.TRUE if this multimap cache contains the key-value pair. |
CompletableFuture<Boolean> |
containsKey(K key)
Returns
Boolean.TRUE if this multimap cache contains the key. |
CompletableFuture<Boolean> |
containsValue(V value)
Asynchronous method that returns
Boolean.TRUE if this multimap cache contains the value at any key. |
CompletableFuture<Collection<V>> |
get(K key)
Returns a view collection of the values associated with key in this multimap cache,
if any.
|
CompletableFuture<MetadataCollection<V>> |
getWithMetadata(K key)
Returns a
MetadataCollection of the values associated with key in this multimap cache,
if any. |
void |
init() |
CompletableFuture<Void> |
put(K key,
V value)
Puts a key-value pair in this multimap cache.
|
CompletableFuture<Boolean> |
remove(K key)
Removes all the key-value pairs associated with the key from this multimap cache, if such exists.
|
CompletableFuture<Boolean> |
remove(K key,
V value)
Removes a key-value pair from this multimap cache, if such exists.
|
CompletableFuture<Long> |
size()
Returns the number of key-value pairs in this multimap cache.
|
boolean |
supportsDuplicates()
Multimap can support duplicates on the same key k → ['a', 'a', 'b'] or not k → ['a', 'b'] depending on
configuration.
|
public RemoteMultimapCacheImpl(RemoteCacheManager rcm, RemoteCache<K,Collection<V>> cache)
public void init()
public CompletableFuture<Void> put(K key, V value)
BasicMultimapCache
put
in interface BasicMultimapCache<K,V>
key
- the key to be putvalue
- the value to addedCompletableFuture
containing a Void
public CompletableFuture<Collection<V>> get(K key)
BasicMultimapCache
get
in interface BasicMultimapCache<K,V>
key
- to be retrievedCompletableFuture
containing
which is a view of the underlying values.public CompletableFuture<MetadataCollection<V>> getWithMetadata(K key)
RemoteMultimapCache
MetadataCollection
of the values associated with key in this multimap cache,
if any. Any changes to the retrieved collection won't change the values in this multimap cache.
When this method returns an empty metadata collection, it means the key was not found.getWithMetadata
in interface RemoteMultimapCache<K,V>
key
- to be retrievedpublic CompletableFuture<Boolean> remove(K key)
BasicMultimapCache
remove
in interface BasicMultimapCache<K,V>
key
- to be removedCompletableFuture
containing Boolean.TRUE
if the entry was removed, and Boolean.FALSE
when the entry was not removedpublic CompletableFuture<Boolean> remove(K key, V value)
BasicMultimapCache
remove
in interface BasicMultimapCache<K,V>
key
- key to be removedvalue
- value to be removedCompletableFuture
containing Boolean.TRUE
if the key-value pair was removed, and Boolean.FALSE
when the key-value pair was not removedpublic CompletableFuture<Boolean> containsKey(K key)
BasicMultimapCache
Boolean.TRUE
if this multimap cache contains the key.containsKey
in interface BasicMultimapCache<K,V>
key
- the key that might exists in this multimap cacheCompletableFuture
containing a Boolean
public CompletableFuture<Boolean> containsValue(V value)
BasicMultimapCache
Boolean.TRUE
if this multimap cache contains the value at any key.containsValue
in interface BasicMultimapCache<K,V>
value
- the value that might exists in any entryCompletableFuture
containing a Boolean
public CompletableFuture<Boolean> containsEntry(K key, V value)
BasicMultimapCache
Boolean.TRUE
if this multimap cache contains the key-value pair.containsEntry
in interface BasicMultimapCache<K,V>
key
- the key of the key-value pairvalue
- the value of the key-value pairCompletableFuture
containing a Boolean
public CompletableFuture<Long> size()
BasicMultimapCache
This method is blocking in a explicit transaction context.
The CompletableFuture
is a
size
in interface BasicMultimapCache<K,V>
CompletableFuture
containing the size as Long
public boolean supportsDuplicates()
BasicMultimapCache
Returns duplicates are supported or not in this multimap cache.
supportsDuplicates
in interface BasicMultimapCache<K,V>
true
if this multimap supports duplicate values for a given key.Copyright © 2021 JBoss by Red Hat. All rights reserved.