public class ArrayUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ArrayUtil.NonConvertable |
Modifier and Type | Field and Description |
---|---|
static ArrayUtil.NonConvertable |
NON_CONVERTABLE
An object indicating that the conversion is not possible
|
Constructor and Description |
---|
ArrayUtil() |
Modifier and Type | Method and Description |
---|---|
static Object |
convertArrayToObject(Object array,
Class destClass)
Convert an array object of which type is T[] to ArrayOfT class.
|
static Object |
convertObjectToArray(Object obj,
Class arrayType)
Convert ArrayOfT to T[].
|
static int |
getArrayDimension(Class arrayType)
Gets the dimension of arrayType
|
static boolean |
isConvertable(Class clazz,
Class arrayType)
Check if the clazz(perhaps ArrayOfT class) can be converted to T[].
|
public static final ArrayUtil.NonConvertable NON_CONVERTABLE
public static Object convertObjectToArray(Object obj, Class arrayType)
obj
- the object of type ArrayOfT to convertarrayType
- the destination array typepublic static boolean isConvertable(Class clazz, Class arrayType)
clazz
- a class of ArrayOfTarrayType
- an array class (T[])public static int getArrayDimension(Class arrayType)
arrayType
- an array classCopyright © The Apache Software Foundation. All Rights Reserved.