public class ArrayUtil extends Object
ArrayUtil
- Array utilities holder.Constructor and Description |
---|
ArrayUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
deepCopy(Object originalArray)
Clone an array.
|
static <T> T |
fromString(String string,
Class<T> arrayClass)
Create array from its
String representation. |
static boolean |
isEquals(Object firstArray,
Object secondArray)
Check if two arrays are equal.
|
static <T> Class<T[]> |
toArrayClass(Class<T> arrayElementClass)
Get the array class for the provided array element class.
|
static <T> T |
unwrapArray(Object[] originalArray,
Class<T> arrayClass)
Unwarp
Object[] array to an array of the provided type |
static Object[] |
wrapArray(Object originalArray)
Wrap a given array so that primitives become wrapper objects.
|
public static <T> T deepCopy(Object originalArray)
T
- array element typeoriginalArray
- original arraypublic static Object[] wrapArray(Object originalArray)
originalArray
- original arraypublic static <T> T unwrapArray(Object[] originalArray, Class<T> arrayClass)
Object[]
array to an array of the provided typeT
- array element typeoriginalArray
- original arrayarrayClass
- array classpublic static <T> T fromString(String string, Class<T> arrayClass)
String
representation.T
- array element typestring
- string representationarrayClass
- array classpublic static boolean isEquals(Object firstArray, Object secondArray)
firstArray
- first arraysecondArray
- second arrayCopyright © 2020. All rights reserved.