Class CoerciveComparator
java.lang.Object
com.invirgance.convirgance.transform.filter.CoerciveComparator
- All Implemented Interfaces:
Comparator
Compares objects of different types, supporting nulls, numbers, and comparables.
- Author:
- jbanes
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
CoerciveComparator
public CoerciveComparator()
-
-
Method Details
-
compare
Compares two objects based on their types. Falling back to hashcode comparison if needed.- Specified by:
comparein interfaceComparator- Parameters:
left- The first Object.right- The second Object.- Returns:
- An integer from -1 to 1. 0 being equality.
-