Interface RetentionPolicy<K,V>
-
- All Known Implementing Classes:
MaxAgePolicy
,MaxCacheSizePolicy
,ValidTimestampPolicy
public interface RetentionPolicy<K,V>
Created by Jeff Gaynor
on Nov 11, 2010 at 1:03:54 PM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
applies()
If this applies to the current cache.Map<K,V>
getMap()
The cache to which this policy is applied.boolean
retain(K key, V value)
-
-
-
Method Detail
-
applies
boolean applies()
If this applies to the current cache. While this is true, theretain(Object, Object)
method will be applied to each element of the cache. When false, this policy will be skipped.
E.g. for a cache that limits the number of cached items, there is no reason to check every item in the cache directly if the cache size is below a certain threshold.- Returns:
-
-