Class CaffeinatedGuavaCache<K,V>

java.lang.Object
com.github.benmanes.caffeine.guava.CaffeinatedGuavaCache<K,V>
All Implemented Interfaces:
com.google.common.cache.Cache<K,V>, Serializable
Direct Known Subclasses:
CaffeinatedGuavaLoadingCache

class CaffeinatedGuavaCache<K,V> extends Object implements com.google.common.cache.Cache<K,V>, Serializable
A Caffeine-backed cache through a Guava facade.
  • Field Details

  • Constructor Details

    • CaffeinatedGuavaCache

      CaffeinatedGuavaCache(Cache<K,V> cache)
  • Method Details

    • getIfPresent

      public @Nullable V getIfPresent(Object key)
      Specified by:
      getIfPresent in interface com.google.common.cache.Cache<K,V>
    • get

      public V get(K key, Callable<? extends V> valueLoader) throws ExecutionException
      Specified by:
      get in interface com.google.common.cache.Cache<K,V>
      Throws:
      ExecutionException
    • getAllPresent

      public com.google.common.collect.ImmutableMap<K,V> getAllPresent(Iterable<?> keys)
      Specified by:
      getAllPresent in interface com.google.common.cache.Cache<K,V>
    • put

      public void put(K key, V value)
      Specified by:
      put in interface com.google.common.cache.Cache<K,V>
    • putAll

      public void putAll(Map<? extends K,? extends V> m)
      Specified by:
      putAll in interface com.google.common.cache.Cache<K,V>
    • invalidate

      public void invalidate(Object key)
      Specified by:
      invalidate in interface com.google.common.cache.Cache<K,V>
    • invalidateAll

      public void invalidateAll(Iterable<?> keys)
      Specified by:
      invalidateAll in interface com.google.common.cache.Cache<K,V>
    • invalidateAll

      public void invalidateAll()
      Specified by:
      invalidateAll in interface com.google.common.cache.Cache<K,V>
    • size

      public long size()
      Specified by:
      size in interface com.google.common.cache.Cache<K,V>
    • stats

      public com.google.common.cache.CacheStats stats()
      Specified by:
      stats in interface com.google.common.cache.Cache<K,V>
    • asMap

      public ConcurrentMap<K,V> asMap()
      Specified by:
      asMap in interface com.google.common.cache.Cache<K,V>
    • cleanUp

      public void cleanUp()
      Specified by:
      cleanUp in interface com.google.common.cache.Cache<K,V>