public class Compare extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Comparable<? super T>> |
compare(T o1,
T o2)
Compares two objects.
null is being treated as smallest value. |
static <T extends Comparable<? super T>> |
compareWithNullLargest(T o1,
T o2)
Compares two objects.
null is being treated as largest value. |
public static <T extends Comparable<? super T>> int compare(T o1, T o2)
null is being treated as smallest value.
Notice the different semantics compared to Objects.compare(java.lang.Object, java.lang.Object, java.util.Comparator)
for null-values.
T - the class typeo1 - the first objecto2 - the second objectpublic static <T extends Comparable<? super T>> int compareWithNullLargest(T o1, T o2)
null is being treated as largest value.T - the class typeo1 - the first objecto2 - the second objectTentackle - distributed, domain- and model-driven