public class ObjectUtils extends java.lang.Object
| Constructor and Description |
|---|
ObjectUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compareInOrder(java.util.function.IntSupplier... comparisonSuppliers)
Evaluates the given comparisons in order.
|
static <T extends java.lang.Comparable<T>> |
compareNullSafe(T object1,
T object2)
Compares the two given objects.
|
static <T> int |
compareNullSafe(T object1,
T object2,
java.util.Comparator<T> comparator)
Compares the two given objects.
|
public ObjectUtils()
public static <T extends java.lang.Comparable<T>> int compareNullSafe(T object1, T object2)
null. If both are non-null, calls
object1.compareTo(object2).
null values will be ordered before non-null values.public static <T> int compareNullSafe(T object1, T object2, java.util.Comparator<T> comparator)
null. If both are non-null, passes
them to the given comparator.
null values will be ordered before non-null values.public static int compareInOrder(java.util.function.IntSupplier... comparisonSuppliers)