Class ArrayHelper
java.lang.Object
io.github.torand.javacommons.collection.ArrayHelper
Helper functions for arrays
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isEmpty
(int[] array) Returns whether the specified 'int' array is null or contains no elements.static boolean
isEmpty
(long[] array) Returns whether the specified 'long' array is null or contains no elements.static <T> boolean
isEmpty
(T[] array) Returns whether the specified object array is null or contains no elements.static boolean
nonEmpty
(int[] array) Returns whether the specified 'int' array contains at least one element.static boolean
nonEmpty
(long[] array) Returns whether the specified 'long' array contains at least one element.static <T> boolean
nonEmpty
(T[] array) Returns whether the specified object array contains at least one element.
-
Method Details
-
isEmpty
public static boolean isEmpty(int[] array) Returns whether the specified 'int' array is null or contains no elements.- Parameters:
array
- the array.- Returns:
- true if the array is null or contains no elements; else false.
-
isEmpty
public static boolean isEmpty(long[] array) Returns whether the specified 'long' array is null or contains no elements.- Parameters:
array
- the array.- Returns:
- true if the array is null or contains no elements; else false.
-
isEmpty
public static <T> boolean isEmpty(T[] array) Returns whether the specified object array is null or contains no elements.- Type Parameters:
T
- the object type.- Parameters:
array
- the array.- Returns:
- true if the array is null or contains no elements; else false.
-
nonEmpty
public static boolean nonEmpty(int[] array) Returns whether the specified 'int' array contains at least one element.- Parameters:
array
- the array.- Returns:
- true if the array contains at least one element; else false.
-
nonEmpty
public static boolean nonEmpty(long[] array) Returns whether the specified 'long' array contains at least one element.- Parameters:
array
- the array.- Returns:
- true if the array contains at least one element; else false.
-
nonEmpty
public static <T> boolean nonEmpty(T[] array) Returns whether the specified object array contains at least one element.- Type Parameters:
T
- the object type.- Parameters:
array
- the array.- Returns:
- true if the array contains at least one element; else false.
-