Class PeekableTouchableCaffeineMap<K,V>

All Implemented Interfaces:
ConcurrentMap<K,InternalCacheEntry<K,V>>, Map<K,InternalCacheEntry<K,V>>, PeekableTouchableMap<K,V>

public class PeekableTouchableCaffeineMap<K,V> extends AbstractDelegatingConcurrentMap<K,InternalCacheEntry<K,V>> implements PeekableTouchableMap<K,V>
  • Constructor Details

    • PeekableTouchableCaffeineMap

      public PeekableTouchableCaffeineMap(com.github.benmanes.caffeine.cache.Cache<K,InternalCacheEntry<K,V>> cache)
  • Method Details

    • delegate

      protected ConcurrentMap<K,InternalCacheEntry<K,V>> delegate()
      Specified by:
      delegate in class AbstractDelegatingConcurrentMap<K,InternalCacheEntry<K,V>>
    • peek

      public InternalCacheEntry<K,V> peek(Object key)
      Description copied from interface: PeekableTouchableMap
      Peaks at a value for the given key. Note that this does not update any expiration or eviction information when this is performed on the map, unlike the get method.
      Specified by:
      peek in interface PeekableTouchableMap<K,V>
      Parameters:
      key - The key to find the value for
      Returns:
      The value mapping to this key
    • touchKey

      public boolean touchKey(Object key, long currentTimeMillis)
      Description copied from interface: PeekableTouchableMap
      Touches the entry for the given key in this map. This method will update any recency timestamps for both expiration or eviction as needed.
      Specified by:
      touchKey in interface PeekableTouchableMap<K,V>
      Parameters:
      key - key to touch
      currentTimeMillis - the recency timestamp to set
      Returns:
      whether the entry was touched or not
    • touchAll

      public void touchAll(long currentTimeMillis)
      Description copied from interface: PeekableTouchableMap
      Touches all entries in the map setting the recency timestamps for both expiration eviction appropriately.
      Specified by:
      touchAll in interface PeekableTouchableMap<K,V>
      Parameters:
      currentTimeMillis - the recency timestamp to set