Class CacheWithStats<K,V>

java.lang.Object
com.atlassian.jira.cache.stats.CacheWithStats<K,V>
All Implemented Interfaces:
com.atlassian.cache.Cache<K,V>, com.atlassian.cache.ReadThroughCache<K,V>

public class CacheWithStats<K,V> extends Object implements com.atlassian.cache.Cache<K,V>
Cache wrap. All methods are redirected to delegate, only removeAll method is wrapped with stats logging.
See Also:
  • Constructor Details

    • CacheWithStats

      public CacheWithStats(com.atlassian.cache.Cache<K,V> delegate, CacheStats stats)
  • Method Details

    • getName

      @Nonnull public String getName()
      Specified by:
      getName in interface com.atlassian.cache.ReadThroughCache<K,V>
    • containsKey

      public boolean containsKey(@Nonnull K k)
      Specified by:
      containsKey in interface com.atlassian.cache.ReadThroughCache<K,V>
    • getKeys

      @Nonnull public Collection<K> getKeys()
      Specified by:
      getKeys in interface com.atlassian.cache.ReadThroughCache<K,V>
    • get

      @Nullable public V get(@Nonnull K k)
      Specified by:
      get in interface com.atlassian.cache.ReadThroughCache<K,V>
    • get

      @Nonnull public V get(@Nonnull K k, @Nonnull com.atlassian.cache.Supplier<? extends V> supplier)
      Specified by:
      get in interface com.atlassian.cache.ReadThroughCache<K,V>
    • put

      public void put(@Nonnull K k, @Nonnull V v)
      Specified by:
      put in interface com.atlassian.cache.Cache<K,V>
    • putIfAbsent

      @Nullable public V putIfAbsent(@Nonnull K k, @Nonnull V v)
      Specified by:
      putIfAbsent in interface com.atlassian.cache.Cache<K,V>
    • remove

      public void remove(@Nonnull K k)
      Specified by:
      remove in interface com.atlassian.cache.ReadThroughCache<K,V>
    • remove

      public boolean remove(@Nonnull K k, @Nonnull V v)
      Specified by:
      remove in interface com.atlassian.cache.ReadThroughCache<K,V>
    • removeAll

      public void removeAll()
      Specified by:
      removeAll in interface com.atlassian.cache.ReadThroughCache<K,V>
    • replace

      public boolean replace(@Nonnull K k, @Nonnull V v, @Nonnull V v1)
      Specified by:
      replace in interface com.atlassian.cache.Cache<K,V>
    • addListener

      public void addListener(@Nonnull com.atlassian.cache.CacheEntryListener<K,V> cacheEntryListener, boolean b)
      Specified by:
      addListener in interface com.atlassian.cache.Cache<K,V>
    • removeListener

      public void removeListener(@Nonnull com.atlassian.cache.CacheEntryListener<K,V> cacheEntryListener)
      Specified by:
      removeListener in interface com.atlassian.cache.Cache<K,V>