Class NoopCache<K,V>

java.lang.Object
net.bluemind.core.utils.NoopCache<K,V>
Type Parameters:
K -
V -
All Implemented Interfaces:
com.github.benmanes.caffeine.cache.Cache<K,V>

public class NoopCache<K,V> extends Object implements com.github.benmanes.caffeine.cache.Cache<K,V>
A cache implementation that remains an empty collection and returns null when trying to access records, only the get function V get(K key, Function<? super K, ? extends V> mappingFunction) will execute the mapping function if it exists
  • Constructor Details

    • NoopCache

      public NoopCache()
  • Method Details

    • getIfPresent

      public V getIfPresent(Object key)
      Specified by:
      getIfPresent in interface com.github.benmanes.caffeine.cache.Cache<K,V>
    • get

      public V get(K key, Function<? super K,? extends V> mappingFunction)
      Specified by:
      get in interface com.github.benmanes.caffeine.cache.Cache<K,V>
    • getAllPresent

      public Map<K,V> getAllPresent(Iterable<?> keys)
      Specified by:
      getAllPresent in interface com.github.benmanes.caffeine.cache.Cache<K,V>
    • put

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

      public void putAll(Map<? extends K,? extends V> map)
      Specified by:
      putAll in interface com.github.benmanes.caffeine.cache.Cache<K,V>
    • invalidate

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

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

      public void invalidateAll()
      Specified by:
      invalidateAll in interface com.github.benmanes.caffeine.cache.Cache<K,V>
    • estimatedSize

      public long estimatedSize()
      Specified by:
      estimatedSize in interface com.github.benmanes.caffeine.cache.Cache<K,V>
    • stats

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

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

      public void cleanUp()
      Specified by:
      cleanUp in interface com.github.benmanes.caffeine.cache.Cache<K,V>
    • policy

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