public class HazelcastPropertyComparator extends Object implements Comparator<Map.Entry<?,?>>, Serializable
Implement a limited form of custom comparison between entries. The fields used for the comparison and the ascending/descending can be specified at run time.
| Constructor and Description |
|---|
HazelcastPropertyComparator(String attributeName,
boolean ascending) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Map.Entry<?,?> o1,
Map.Entry<?,?> o2)
Use Hazelcast's
ReflectionHelper to extract a field in an entry, and use this is in the comparison. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic HazelcastPropertyComparator(String attributeName, boolean ascending)
public int compare(Map.Entry<?,?> o1, Map.Entry<?,?> o2)
Use Hazelcast's ReflectionHelper to extract a field in an entry, and use this is in the comparison.
compare in interface Comparator<Map.Entry<?,?>>o1 - An entry in a mapo2 - Another entry in the mapCopyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.