public final class Arrays
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> java.util.List<T> |
asList(T[] array)
Returns the array as a list
|
static <T> ReifiedList<T> |
asReifiedList(T[] array)
Returns the array as a reified list
|
static <T> T |
getElement(T[] array,
int _index)
Returns the element at specified index
|
static <T> T |
getElementNulling(T[] array,
int _index)
Returns the element at specified index, but if this is not possible, it returns null
|
static <T> T |
getElementSafe(T[] array,
int _index,
T _defaultValue)
Returns the element at specified index, but if this is not possible, it returns the specified default value
|
static <T> int |
length(T[] array)
Returns the length of the array
|
static <T> T[] |
subArray(T[] array,
int _startIndex,
int _endIndex)
Returns a portion of the array
|
static <T> java.lang.String |
toStringify(T[] array)
Returns the string representation of the array
|
static <T> java.lang.String |
toStringifyDeep(T[] array)
Returns the deep string representation of the array
|
public static <T> java.util.List<T> asList(T[] array)
java.lang.NullPointerException
- An argument is nulljava.lang.ArrayIndexOutOfBoundsException
- The index is out of boundspublic static <T> ReifiedList<T> asReifiedList(T[] array)
java.lang.NullPointerException
- An argument is nulljava.lang.ArrayIndexOutOfBoundsException
- The index is out of boundspublic static <T> T getElement(T[] array, int _index)
java.lang.NullPointerException
- An argument is nulljava.lang.ArrayIndexOutOfBoundsException
- The index is out of boundspublic static <T> T getElementNulling(T[] array, int _index)
java.lang.NullPointerException
- An argument is nulljava.lang.ArrayIndexOutOfBoundsException
- The index is out of boundspublic static <T> T getElementSafe(T[] array, int _index, T _defaultValue)
public static <T> int length(T[] array)
java.lang.NullPointerException
- An argument is nullpublic static <T> T[] subArray(T[] array, int _startIndex, int _endIndex)
java.lang.NullPointerException
- An argument is nulljava.lang.ArrayIndexOutOfBoundsException
- An argument is nullpublic static <T> java.lang.String toStringify(T[] array)
java.lang.NullPointerException
- An argument is nulljava.lang.ArrayIndexOutOfBoundsException
- The index is out of boundspublic static <T> java.lang.String toStringifyDeep(T[] array)
java.lang.NullPointerException
- An argument is nulljava.lang.ArrayIndexOutOfBoundsException
- The index is out of bounds