Package org.ehcache.config
Interface EvictionAdvisor<K,V>
- Type Parameters:
K- the key type for the cacheV- 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.
A specialized predicate used to advise on eviction of cache entries.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanadviseAgainstEviction(K key, V value) Returnstrueif the given key value pair should not be evicted if possible.
-
Method Details
-
adviseAgainstEviction
Returnstrueif 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 keyvalue- the cache value- Returns:
trueif eviction should be avoided,falseotherwise
-