Class AbstractCache<K,​V>

  • Type Parameters:
    K - the cache entry key type.
    V - the cache entry value type.
    All Implemented Interfaces:
    com.google.common.cache.Cache<K,​V>

    public abstract class AbstractCache<K,​V>
    extends Object
    implements com.google.common.cache.Cache<K,​V>
    Almost ready-to-use generic Cache implementation.

    This class implements all the methods whose behavior or result can be derived from the not-implemented methods. Applications can extend this class to provide only the required (not-derivable) behavior; however, if the underlying implementation is better, in terms of performance, for a given derived method, they MUST override it and use the better performance implementation.

    Since:
    3.3.0
    • Constructor Detail

      • AbstractCache

        public AbstractCache()
    • Method Detail

      • putAll

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

        public com.google.common.collect.ImmutableMap<K,​V> getAllPresent​(Iterable<?> keys)
        Specified by:
        getAllPresent 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()
        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>