Class CaffeinatedGuavaCache<K,​V>

  • All Implemented Interfaces:
    com.google.common.cache.Cache<K,​V>, java.io.Serializable
    Direct Known Subclasses:
    CaffeinatedGuavaLoadingCache

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

      Fields 
      Modifier and Type Field Description
      (package private) Cache<K,​V> cache  
      (package private) static long serialVersionUID  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.ConcurrentMap<K,​V> asMap()  
      void cleanUp()  
      V get​(K key, java.util.concurrent.Callable<? extends V> valueLoader)  
      com.google.common.collect.ImmutableMap<K,​V> getAllPresent​(java.lang.Iterable<?> keys)  
      @Nullable V getIfPresent​(java.lang.Object key)  
      void invalidate​(java.lang.Object key)  
      void invalidateAll()  
      void invalidateAll​(java.lang.Iterable<?> keys)  
      void put​(K key, V value)  
      void putAll​(java.util.Map<? extends K,​? extends V> m)  
      long size()  
      com.google.common.cache.CacheStats stats()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CaffeinatedGuavaCache

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

      • getIfPresent

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

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

        public com.google.common.collect.ImmutableMap<K,​V> getAllPresent​(java.lang.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​(java.util.Map<? extends K,​? extends V> m)
        Specified by:
        putAll in interface com.google.common.cache.Cache<K,​V>
      • invalidate

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

        public void invalidateAll​(java.lang.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 java.util.concurrent.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>