Class ObjectTools

java.lang.Object
rife.bld.extension.tools.ObjectTools

public final class ObjectTools extends Object
Object Tools.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isAnyNull(Collection<?> collection)
    Checks if any element in the collection is null.
    static <T> boolean
    isAnyNull(T... objects)
    Checks if any of the provided objects are null.
    static boolean
    isEmpty(Collection<?> collection)
    Checks if the provided collection is empty or null.
    static boolean
    isEmpty(Map<?,?> map)
    Checks if the provided Map is empty or null.
    static <T> boolean
    isEmpty(T[] array)
    Checks if the provided array is empty or null.
    static <T> boolean
    isEmpty(T[]... arrays)
    Checks if all provided arrays are empty or null.
    static boolean
    isNotEmpty(Collection<?> collection)
    Checks if the provided collection is not null and not empty.
    static boolean
    isNotEmpty(Map<?,?> map)
    Checks if the provided Map is not null and not empty.
    static <T> boolean
    isNotEmpty(T[] array)
    Checks if the provided array is not null and not empty.
    static <T> boolean
    isNotEmpty(T[]... arrays)
    Checks if any of the provided arrays are not null and not empty.
    static boolean
    isNotNull(Collection<?> collection)
    Checks if all elements in the collection are non-null.
    static <T> boolean
    isNotNull(T... objects)
    Checks if all provided objects are non-null.
    static boolean
    isNull(Collection<?> collection)
    Checks if all elements in the collection are null.
    static <T> boolean
    isNull(T... objects)
    Checks if all provided objects are null.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isAnyNull

      @SafeVarargs public static <T> boolean isAnyNull(T... objects)
      Checks if any of the provided objects are null.
      Parameters:
      objects - the objects to check
      Returns:
      true if any object is null, false otherwise
      Since:
      1.0
    • isAnyNull

      public static boolean isAnyNull(Collection<?> collection)
      Checks if any element in the collection is null.
      Parameters:
      collection - the collection to check
      Returns:
      true if any element is null, false otherwise
      Since:
      1.0
    • isEmpty

      public static <T> boolean isEmpty(T[] array)
      Checks if the provided array is empty or null.
      Parameters:
      array - The array to check; can be null
      Returns:
      true if the array is null or empty; false otherwise
      Since:
      1.0
    • isEmpty

      public static boolean isEmpty(Map<?,?> map)
      Checks if the provided Map is empty or null.
      Parameters:
      map - The map to check; can be null
      Returns:
      true if the map is null or empty; false otherwise
      Since:
      1.0
    • isEmpty

      @SafeVarargs public static <T> boolean isEmpty(T[]... arrays)
      Checks if all provided arrays are empty or null.
      Parameters:
      arrays - The arrays to check; can be null or contain null elements
      Returns:
      true if all arrays are null or empty; false if any array is not empty
      Since:
      1.0
    • isEmpty

      public static boolean isEmpty(Collection<?> collection)
      Checks if the provided collection is empty or null.
      Parameters:
      collection - The collection to check; can be null
      Returns:
      true if the collection is null or empty; false otherwise
      Since:
      1.0
    • isEmpty

      @SafeVarargs public static <T extends Collection<?>> boolean isEmpty(T... collections)
      Checks if all provided collections are empty or null.
      Parameters:
      collections - The collections to check; can be null or contain null elements
      Returns:
      true if all collections are null or empty; false if any collection is not empty
      Since:
      1.0
    • isNotEmpty

      public static <T> boolean isNotEmpty(T[] array)
      Checks if the provided array is not null and not empty.
      Parameters:
      array - The array to check; can be null
      Returns:
      true if the array is not null and not empty; false otherwise
      Since:
      1.0
    • isNotEmpty

      public static boolean isNotEmpty(Map<?,?> map)
      Checks if the provided Map is not null and not empty.
      Parameters:
      map - The map to check; can be null
      Returns:
      true if the map is not null and not empty; false otherwise
      Since:
      1.0
    • isNotEmpty

      @SafeVarargs public static <T> boolean isNotEmpty(T[]... arrays)
      Checks if any of the provided arrays are not null and not empty.
      Parameters:
      arrays - The arrays to check; can be null or contain null elements
      Returns:
      true if any array is not null and not empty; false if all are null or empty
      Since:
      1.0
    • isNotEmpty

      public static boolean isNotEmpty(Collection<?> collection)
      Checks if the provided collection is not null and not empty.
      Parameters:
      collection - The collection to check; can be null
      Returns:
      true if the collection is not null and not empty; false otherwise
      Since:
      1.0
    • isNotEmpty

      @SafeVarargs public static <T extends Collection<?>> boolean isNotEmpty(T... collections)
      Checks if any of the provided collections are not null and not empty.
      Parameters:
      collections - The collections to check; can be null or contain null elements
      Returns:
      true if any collection is not null and not empty; false if all are null or empty
      Since:
      1.0
    • isNotNull

      @SafeVarargs public static <T> boolean isNotNull(T... objects)
      Checks if all provided objects are non-null.
      Parameters:
      objects - the objects to check
      Returns:
      true if all objects are non-null, false otherwise
      Since:
      1.0
    • isNotNull

      public static boolean isNotNull(Collection<?> collection)
      Checks if all elements in the collection are non-null.
      Parameters:
      collection - the collection to check
      Returns:
      true if all elements are non-null, false otherwise
      Since:
      1.0
    • isNull

      @SafeVarargs public static <T> boolean isNull(T... objects)
      Checks if all provided objects are null.
      Parameters:
      objects - the objects to check
      Returns:
      true if all objects are null, false otherwise
      Since:
      1.0
    • isNull

      public static boolean isNull(Collection<?> collection)
      Checks if all elements in the collection are null.
      Parameters:
      collection - the collection to check
      Returns:
      true if all elements are null, false otherwise
      Since:
      1.0