LoadingCache interface to minimize
the effort required to implement a LocalCache.
| Modifier and Type | Method and Description |
|---|---|
| public @Nullable Function | |
| public AsyncCacheLoader | |
| public default V | get(K
the key with which the specified value is to be associated key)Implements com. key in this cache, obtaining that value from
CacheLoader#load(Object) if necessary.
|
| public default Map | getAll(Iterable<? extends K>
the keys whose associated values are to be returned keys)Implements com. keys, creating or retrieving those
values if necessary.
|
| public static boolean | hasLoadAll(CacheLoader<?, ?> loader)
Returns whether the supplied cache loader has bulk load functionality. |
| public default Map | |
| public Function | |
| public static <K, V> @Nullable Function | newBulkMappingFunction(CacheLoader<? super K, V> cacheLoader)
Returns a mapping function that adapts to |
| public static <K, V> Function | newMappingFunction(CacheLoader<? super K, V> cacheLoader)
Returns a mapping function that adapts to |
| public default CompletableFuture | refresh(K
key with which a value may be associated key)Implements com. key, asynchronously.
|
| public default CompletableFuture | refreshAll(Iterable<? extends K>
the keys whose associated values are to be returned keys)Implements com. key, asynchronously.
|
| logger | back to summary |
|---|---|
| public static final System. | |
| bulkMappingFunction | back to summary |
|---|---|
| public @Nullable Function Returns the | |
| cacheLoader | back to summary |
|---|---|
| public AsyncCacheLoader Returns the | |
| get | back to summary |
|---|---|
| public default V get(K key) Implements com. Doc from com. Returns the value associated with the
If another call to
If the specified key is not already associated with a value, attempts to compute its value and
enters it into this cache unless
| |
| getAll | back to summary |
|---|---|
| public default Map Implements com. Doc from com. Returns a map of the values associated with the
Caches loaded by a
Note that duplicate elements in | |
| hasLoadAll | back to summary |
|---|---|
| public static boolean hasLoadAll(CacheLoader<?, ?> loader) Returns whether the supplied cache loader has bulk load functionality. | |
| loadSequentially | back to summary |
|---|---|
| public default Map Sequentially loads each missing entry. | |
| mappingFunction | back to summary |
|---|---|
| public Function Returns the | |
| newBulkMappingFunction | back to summary |
|---|---|
| public static <K, V> @Nullable Function Returns a mapping function that adapts to | |
| newMappingFunction | back to summary |
|---|---|
| public static <K, V> Function Returns a mapping function that adapts to | |
| refresh | back to summary |
|---|---|
| public default CompletableFuture Implements com. Doc from com. Loads a new value for the
Caches loaded by a
Returns an existing future without doing anything if another thread is currently loading the
value for
| |
| refreshAll | back to summary |
|---|---|
| public default CompletableFuture Implements com. Doc from com. Loads a new value for each
Caches loaded by a
| |