Class ObjectUtils
java.lang.Object
overit.geocallapp.utilities.datatype.ObjectUtils
Utility class providing generic objects manipulation operations.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareAllNotNull(Object... objects) Checks whether the given objects are all not null.static booleanareAllNull(Object... objects) Checks whether the given objects are all null.static <T extends Comparable<T>>
intsafeCompareTo(T object1, T object2) Compares the given objects for order.static booleansafeEquals(Object object1, Object object2) Checks whether the given objects are equals.
-
Method Details
-
areAllNotNull
Checks whether the given objects are all not null.- Parameters:
objects- the objects to check- Returns:
- true if the objects are all not null, false if there is at least a null object
-
areAllNull
Checks whether the given objects are all null.- Parameters:
objects- the objects to check- Returns:
- true if the objects are all null, false if there is at least a not null object
-
safeEquals
Checks whether the given objects are equals.- Parameters:
object1- the first objectobject2- the second object- Returns:
- true if the objects are both null or the first object is equal to the second, false otherwise
-
safeCompareTo
Compares the given objects for order.- Type Parameters:
T- the type of objects- Parameters:
object1- the first object to be comparedobject2- the second object to be compared- Returns:
- a negative integer, zero, or a positive integer as the first parameter is less than, equal to, or greater than the second parameter
-