public class NamedCaffeineCache<K,V> extends Object implements com.github.benmanes.caffeine.cache.AsyncCache<K,V>
Constructor and Description |
---|
NamedCaffeineCache(String name,
com.github.benmanes.caffeine.cache.AsyncCache<K,V> cache) |
Modifier and Type | Method and Description |
---|---|
ConcurrentMap<K,CompletableFuture<V>> |
asMap() |
CompletableFuture<V> |
get(K key,
BiFunction<? super K,Executor,CompletableFuture<V>> mappingFunction) |
CompletableFuture<V> |
get(K key,
Function<? super K,? extends V> mappingFunction) |
CompletableFuture<Map<K,V>> |
getAll(Iterable<? extends K> keys,
BiFunction<Iterable<? extends K>,Executor,CompletableFuture<Map<K,V>>> mappingFunction) |
CompletableFuture<Map<K,V>> |
getAll(Iterable<? extends K> keys,
Function<Iterable<? extends K>,Map<K,V>> mappingFunction) |
CompletableFuture<V> |
getIfPresent(Object key) |
String |
getName() |
void |
put(K key,
CompletableFuture<V> value) |
com.github.benmanes.caffeine.cache.Cache<K,V> |
synchronous() |
public String getName()
@CheckForNull public CompletableFuture<V> getIfPresent(@Nonnull Object key)
@CheckForNull public CompletableFuture<V> get(@Nonnull K key, @Nonnull Function<? super K,? extends V> mappingFunction)
@Nonnull public CompletableFuture<V> get(@Nonnull K key, @Nonnull BiFunction<? super K,Executor,CompletableFuture<V>> mappingFunction)
@Nonnull public CompletableFuture<Map<K,V>> getAll(@Nonnull Iterable<? extends K> keys, @Nonnull Function<Iterable<? extends K>,Map<K,V>> mappingFunction)
@Nonnull public CompletableFuture<Map<K,V>> getAll(@Nonnull Iterable<? extends K> keys, @Nonnull BiFunction<Iterable<? extends K>,Executor,CompletableFuture<Map<K,V>>> mappingFunction)
public void put(@Nonnull K key, @Nonnull CompletableFuture<V> value)
@Nonnull public ConcurrentMap<K,CompletableFuture<V>> asMap()