Class ObjectUtils

java.lang.Object
overit.geocallapp.utilities.datatype.ObjectUtils

public class ObjectUtils extends Object
Utility class providing generic objects manipulation operations.
Since:
1.0
  • Method Details

    • areAllNotNull

      public static boolean areAllNotNull(Object... objects)
      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

      public static boolean areAllNull(Object... objects)
      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

      public static boolean safeEquals(Object object1, Object object2)
      Checks whether the given objects are equals.
      Parameters:
      object1 - the first object
      object2 - the second object
      Returns:
      true if the objects are both null or the first object is equal to the second, false otherwise
    • safeCompareTo

      public static <T extends Comparable<T>> int safeCompareTo(T object1, T object2)
      Compares the given objects for order.
      Type Parameters:
      T - the type of objects
      Parameters:
      object1 - the first object to be compared
      object2 - 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