Interface EvictionAdvisor<K,V>

Type Parameters:
K - the key type for the cache
V - the value type for the cache
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface EvictionAdvisor<K,V>
A specialized predicate used to advise on eviction of cache entries.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    adviseAgainstEviction(K key, V value)
    Returns true if the given key value pair should not be evicted if possible.
  • Method Details

    • adviseAgainstEviction

      boolean adviseAgainstEviction(K key, V value)
      Returns true if the given key value pair should not be evicted if possible.

      Any exception thrown from this method will be logged and the result considered false.

      Parameters:
      key - the cache key
      value - the cache value
      Returns:
      true if eviction should be avoided, false otherwise