Interface RetentionPolicy<K,​V>

    • Method Detail

      • retain

        boolean retain​(K key,
                       V value)
      • getMap

        Map<K,​V> getMap()
        The cache to which this policy is applied.
        Returns:
      • applies

        boolean applies()
        If this applies to the current cache. While this is true, the retain(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: