Package io.micronaut.core.util.clhm
Interface EntryWeigher<K,V>
- Type Parameters:
K
- The key typeV
- The value type
public interface EntryWeigher<K,V>
A class that can determine the weight of an entry. The total weight threshold
is used to determine when an eviction is required.
- Author:
- ben.manes@gmail.com (Ben Manes)
- See Also:
-
Method Summary
-
Method Details
-
weightOf
Measures an entry's weight to determine how many units of capacity that the key and value consumes. An entry must consume a minimum of one unit.- Parameters:
key
- the key to weighvalue
- the value to weigh- Returns:
- the entry's weight
-