Package com.hazelcast.cache
Interface CacheEvictionPolicyComparator<K,V>
-
- Type Parameters:
K
- type of the keyV
- type of the value
- All Superinterfaces:
java.util.Comparator<CacheEntryView<K,V>>
,EvictionPolicyComparator<K,V,CacheEntryView<K,V>>
,java.io.Serializable
- 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 CacheEvictionPolicyComparator<K,V> extends EvictionPolicyComparator<K,V,CacheEntryView<K,V>>
ICache
specificEvictionPolicyComparator
for comparingCacheEntryView
s to be evicted. Implementors of the comparator have to implementequals
andhashCode
methods to support correct config comparison.- See Also:
EvictionPolicyComparator
,CacheEntryView
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
compare(CacheEntryView<K,V> o1, CacheEntryView<K,V> o2)
Compares the givenCacheEntryView
instances and returns the result.
-
-
-
Method Detail
-
compare
int compare(CacheEntryView<K,V> o1, CacheEntryView<K,V> o2)
Compares the givenCacheEntryView
instances and returns the result. The result should be one of- -1: first entry has higher priority to be evicted
- 1: second entry has higher priority to be evicted
- 0: both entries have same priority
- Specified by:
compare
in interfacejava.util.Comparator<K>
- Parameters:
o1
- the firstCacheEntryView
instance to be comparedo2
- the secondCacheEntryView
instance to be compared- Returns:
- the result of comparison
-
-