public class ToStringComparator extends Object implements Comparator<Object>
It handles null values, sorting them according to their printed representation "null".
Modifier and Type | Field and Description |
---|---|
static ToStringComparator |
instance
The unique instance (this class is a singleton).
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object o1,
Object o2) |
static <T> List<T> |
sorted(Iterable<T> in)
Returns a copy of the input, sorted according to the elements'
toString() . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static ToStringComparator instance
public int compare(Object o1, Object o2)
compare
in interface Comparator<Object>