Class NamedCaffeineCache<K,​V>

  • All Implemented Interfaces:
    com.github.benmanes.caffeine.cache.AsyncCache<K,​V>

    public class NamedCaffeineCache<K,​V>
    extends Object
    implements com.github.benmanes.caffeine.cache.AsyncCache<K,​V>
    • Constructor Detail

      • NamedCaffeineCache

        public NamedCaffeineCache​(String name,
                                  com.github.benmanes.caffeine.cache.AsyncCache<K,​V> cache)
    • Method Detail

      • getName

        public String getName()
      • getIfPresent

        @CheckForNull
        public CompletableFuture<V> getIfPresent​(@Nonnull
                                                 K key)
        Specified by:
        getIfPresent in interface com.github.benmanes.caffeine.cache.AsyncCache<K,​V>
      • get

        @CheckForNull
        public CompletableFuture<V> get​(@Nonnull
                                        K key,
                                        @Nonnull
                                        Function<? super K,​? extends V> mappingFunction)
        Specified by:
        get in interface com.github.benmanes.caffeine.cache.AsyncCache<K,​V>
      • getAll

        @Nonnull
        public CompletableFuture<Map<K,​V>> getAll​(@Nonnull
                                                        Iterable<? extends K> keys,
                                                        @Nonnull
                                                        Function<? super Set<? extends K>,​? extends Map<? extends K,​? extends V>> mappingFunction)
        Specified by:
        getAll in interface com.github.benmanes.caffeine.cache.AsyncCache<K,​V>
      • put

        public void put​(@Nonnull
                        K key,
                        @Nonnull
                        CompletableFuture<? extends V> value)
        Specified by:
        put in interface com.github.benmanes.caffeine.cache.AsyncCache<K,​V>
      • synchronous

        public com.github.benmanes.caffeine.cache.Cache<K,​V> synchronous()
        Specified by:
        synchronous in interface com.github.benmanes.caffeine.cache.AsyncCache<K,​V>