Package rs.baselib.util
Class DefaultComparator
java.lang.Object
rs.baselib.util.DefaultComparator
- All Implemented Interfaces:
Comparator<Object>
Default comparator for objects.
The comparator compares NULL-safe and evaluates interfaces that help
when comparing, such as
Comparable
. If none of these
interfaces are implemented then the Object.toString()
values will be ignore with String.compareToIgnoreCase(String)
.- Author:
- ralph
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparator<Object>
A default final instance for fast usage -
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
INSTANCE
A default final instance for fast usage
-
-
Constructor Details
-
DefaultComparator
public DefaultComparator()Constructor.
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<Object>
-