public final class ComparatorExtensions extends Object
ComparatorExtensions have helper methods for comparators.| Constructor and Description |
|---|
ComparatorExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Comparable<T>> |
compare(T object,
T compareWithObject)
Compares the given objects and returns the int value.
|
static <T extends Comparable<T>> |
compare(T object,
T compareWithObject,
SortOrder sortOrder)
Compares the given objects and returns the int value.
|
static <T> Boolean |
equalNullCheck(T object,
T compareWithObject)
Null check of the given objects that is intended for use in equals method.
|
static <T> Integer |
nullCheck(T object,
T compareWithObject)
Checks if one of the given objects are null and returns the value for the Comparator or null
if both are not null or if the given objects are not the same Object.
|
static <T> Integer |
nullCheck(T object,
T compareWithObject,
boolean nullIsGreaterThan)
Checks if one of the given objects are null and returns the value for the Comparator or null
if both are not null or if the given objects are not the same Object.
|
public static <T extends Comparable<T>> int compare(T object, T compareWithObject)
T - the generic typeobject - the objectcompareWithObject - the object to compare with.public static <T extends Comparable<T>> int compare(T object, T compareWithObject, SortOrder sortOrder)
T - the generic typeobject - the objectcompareWithObject - the object to compare with.sortOrder - the sort orderpublic static <T> Boolean equalNullCheck(T object, T compareWithObject)
T - the generic typeobject - the objectcompareWithObject - the compare with objectpublic static <T> Integer nullCheck(T object, T compareWithObject)
T - the generic typeobject - the objectcompareWithObject - the compare with objectpublic static <T> Integer nullCheck(T object, T compareWithObject, boolean nullIsGreaterThan)
T - the generic typeobject - the objectcompareWithObject - the compare with objectnullIsGreaterThan - the flag that says if null objects are greaterCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.