get(Object, Function) or put(Object, CompletableFuture), and are stored in the
cache until either evicted or manually invalidated.
Implementations of this interface are expected to be thread-safe and can be safely accessed by multiple concurrent threads.
| Modifier and Type | Method and Description |
|---|---|
| public ConcurrentMap | |
| public CompletableFuture | Returns: the current (existing or computed) future value associated with the specified keythe key with which the specified value is to be associated key, Function<? super K, ? extends V> the function to asynchronously compute a value mappingFunction)Returns the future associated with the |
| public CompletableFuture | Returns: the current (existing or computed) future value associated with the specified keythe key with which the specified value is to be associated key, BiFunction<? super K, ? super Executor, ? extends CompletableFuture<? extends V>> the function to asynchronously compute a value, optionally using the
given executor mappingFunction)Returns the future associated with the |
| public CompletableFuture | Returns: a future containing an unmodifiable mapping of keys to values for the specified keys in this cachethe keys whose associated values are to be returned keys, Function<? super Set<? extends K>, ? extends Map<? extends K, ? extends V>> the function to asynchronously compute the values mappingFunction)Returns the future of a map of the values associated with the |
| public CompletableFuture | Returns: a future containing an unmodifiable mapping of keys to values for the specified keys in this cachethe keys whose associated values are to be returned keys, BiFunction<? super Set<? extends K>, ? super Executor, ? extends CompletableFuture<? extends Map<? extends K, ? extends V>>> the function to asynchronously compute the values, optionally using the
given executor mappingFunction)Returns the future of a map of the values associated with the |
| public @Nullable CompletableFuture | Returns: the future value to which the specified key is mapped, ornull if this cache
does not contain a mapping for the keythe key whose associated value is to be returned key)Returns the future associated with the |
| public void | put(K
the key with which the specified value is to be associated key, CompletableFuture<? extends V> the value to be associated with the specified key valueFuture)Associates |
| public Cache | Returns: a thread-safe synchronous view of this cacheReturns a view of the entries stored in this cache as a synchronous |
| asMap | back to summary |
|---|---|
| public ConcurrentMap Returns a view of the entries stored in this cache as a thread-safe map. Modifications made to the map directly affect the cache.
A computation operation, such as Iterators from the returned map are at least weakly consistent: they are safe for concurrent use, but if the cache is modified (including by eviction) after the iterator is created, it is undefined which of the changes (if any) will be reflected in that iterator.
| |
| get | back to summary |
|---|---|
| public CompletableFuture Returns the future associated with the
If the specified key is not already associated with a value, attempts to compute its value
asynchronously and enters it into this cache unless Warning as with
| |
| get | back to summary |
|---|---|
| public CompletableFuture Returns the future associated with the
If the specified key is not already associated with a value, attempts to compute its value
asynchronously and enters it into this cache unless Warning as with
| |
| getAll | back to summary |
|---|---|
| public CompletableFuture Returns the future of a map of the values associated with the
A single request to the
Note that duplicate elements in
| |
| getAll | back to summary |
|---|---|
| public CompletableFuture Returns the future of a map of the values associated with the
A single request to the
Note that duplicate elements in
| |
| getIfPresent | back to summary |
|---|---|
| public @Nullable CompletableFuture Returns the future associated with the
| |
| put | back to summary |
|---|---|
| public void put(K key, CompletableFuture<? extends V> valueFuture) Associates
Prefer
| |
| synchronous | back to summary |
|---|---|
| public Cache Returns a view of the entries stored in this cache as a synchronous
| |