public class Arrays
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
Arrays() |
| Modifier and Type | Method and Description |
|---|---|
static int[] |
array(java.util.concurrent.atomic.AtomicIntegerArray atomicIntegerArray)
Returns an int[] from the
AtomicIntegerArray, null if the given atomic array is null. |
static long[] |
array(java.util.concurrent.atomic.AtomicLongArray atomicLongArray)
Returns an long[] from the
AtomicLongArray, null if the given atomic array is null. |
static <T> T[] |
array(java.util.concurrent.atomic.AtomicReferenceArray<T> atomicReferenceArray)
Returns an T[] from the
AtomicReferenceArray, null if the given atomic array is null. |
static <T> T[] |
array(T... values)
Returns an array containing the given arguments.
|
static <T> boolean |
hasOnlyNullElements(T[] array)
Returns
true if the given array has only null elements, false otherwise. |
static boolean |
isArray(java.lang.Object o)
Indicates whether the given object is not
null and is an array. |
static boolean |
isArrayTypePrimitive(java.lang.Object o) |
private static <T> boolean |
isEmpty(T[] array) |
static <T> boolean |
isNullOrEmpty(T[] array)
Indicates whether the given array is
null or empty. |
static boolean |
isObjectArray(java.lang.Object o) |
static <T> java.util.List<T> |
nonNullElementsIn(T[] array)
Returns all the non-
null elements in the given array. |
static java.lang.IllegalArgumentException |
notAnArrayOfPrimitives(java.lang.Object o) |
public static boolean isArray(java.lang.Object o)
null and is an array.o - the given object.true if the given object is not null and is an array, otherwise false.public static <T> boolean isNullOrEmpty(T[] array)
null or empty.T - the type of elements of the array.array - the array to check.true if the given array is null or empty, otherwise false.@SafeVarargs public static <T> T[] array(T... values)
T - the type of the array to return.values - the values to store in the array.public static int[] array(java.util.concurrent.atomic.AtomicIntegerArray atomicIntegerArray)
AtomicIntegerArray, null if the given atomic array is null.atomicIntegerArray - the AtomicIntegerArray to convert to int[].public static long[] array(java.util.concurrent.atomic.AtomicLongArray atomicLongArray)
AtomicLongArray, null if the given atomic array is null.atomicLongArray - the AtomicLongArray to convert to long[].public static <T> T[] array(java.util.concurrent.atomic.AtomicReferenceArray<T> atomicReferenceArray)
AtomicReferenceArray, null if the given atomic array is null.atomicReferenceArray - the AtomicReferenceArray to convert to T[].public static <T> java.util.List<T> nonNullElementsIn(T[] array)
null elements in the given array.T - the type of elements of the array.array - the given array.null elements in the given array. An empty list is returned if the given array is
null.public static <T> boolean hasOnlyNullElements(T[] array)
true if the given array has only null elements, false otherwise. If given array is
empty, this method returns true.T - the type of elements of the array.array - the given array. It must not be null.true if the given array has only null elements or is empty, false otherwise.java.lang.NullPointerException - if the given array is null.private static <T> boolean isEmpty(T[] array)
public static boolean isObjectArray(java.lang.Object o)
public static boolean isArrayTypePrimitive(java.lang.Object o)
public static java.lang.IllegalArgumentException notAnArrayOfPrimitives(java.lang.Object o)