Class ComparableOrToStringComparator
- java.lang.Object
-
- uk.gov.gchq.gaffer.data.element.comparison.ComparableOrToStringComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<Object>
public class ComparableOrToStringComparator extends Object implements Comparator<Object>, Serializable
AComparableOrToStringComparator
is aComparator
which compares two objects using their nativeComparator.compare(Object, Object)
method if it is available and falls back onto a comparison of theirObject.toString()
values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ComparableOrToStringComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Object vertex1, Object vertex2)
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(Object vertex1, Object vertex2)
- Specified by:
compare
in interfaceComparator<Object>
-
-