public class ArrayUtils extends Object
Modifier and Type | Field and Description |
---|---|
static boolean[] |
EMPTY_BOOLEAN_ARRAY
An empty immutable
boolean array. |
static Boolean[] |
EMPTY_BOOLEAN_OBJECT_ARRAY
An empty immutable
Boolean array. |
static byte[] |
EMPTY_BYTE_ARRAY
An empty immutable
byte array. |
static Byte[] |
EMPTY_BYTE_OBJECT_ARRAY
An empty immutable
Byte array. |
static double[] |
EMPTY_DOUBLE_ARRAY
An empty immutable
double array. |
static Double[] |
EMPTY_DOUBLE_OBJECT_ARRAY
An empty immutable
Double array. |
static float[] |
EMPTY_FLOAT_ARRAY
An empty immutable
float array. |
static Float[] |
EMPTY_FLOAT_OBJECT_ARRAY
An empty immutable
Float array. |
static int[] |
EMPTY_INT_ARRAY
An empty immutable
int array. |
static Integer[] |
EMPTY_INTEGER_OBJECT_ARRAY
An empty immutable
Integer array. |
static long[] |
EMPTY_LONG_ARRAY
An empty immutable
long array. |
static Long[] |
EMPTY_LONG_OBJECT_ARRAY
An empty immutable
Long array. |
static short[] |
EMPTY_SHORT_ARRAY
An empty immutable
short array. |
static Short[] |
EMPTY_SHORT_OBJECT_ARRAY
An empty immutable
Short array. |
static String[] |
EMPTY_STRING_ARRAY
An empty immutable
String array. |
Modifier and Type | Method and Description |
---|---|
static Boolean[] |
toObject(boolean[] array)
Converts an array of primitive booleans to objects.
|
static Byte[] |
toObject(byte[] array)
Converts an array of primitive bytes to objects.
|
static Double[] |
toObject(double[] array)
Converts an array of primitive doubles to objects.
|
static Float[] |
toObject(float[] array)
Converts an array of primitive floats to objects.
|
static Integer[] |
toObject(int[] array)
Converts an array of primitive ints to objects.
|
static Long[] |
toObject(long[] array)
Converts an array of primitive longs to objects.
|
static Short[] |
toObject(short[] array)
Converts an array of primitive shorts to objects.
|
static boolean[] |
toPrimitiveBoolean(Object[] array)
Converts an array of object Booleans to primitives.
|
static byte[] |
toPrimitiveByte(Object[] array)
Converts an array of object Bytes to primitives.
|
static double[] |
toPrimitiveDouble(Object[] array)
Converts an array of object Doubles to primitives.
|
static float[] |
toPrimitiveFloat(Object[] array)
Converts an array of object Floats to primitives.
|
static int[] |
toPrimitiveInteger(Object[] array)
Converts an array of object Integers to primitives.
|
static long[] |
toPrimitiveLong(Object[] array)
Converts an array of object Longs to primitives.
|
static short[] |
toPrimitiveShort(Object[] array)
Converts an array of object Shorts to primitives.
|
public static final String[] EMPTY_STRING_ARRAY
String
array.public static final long[] EMPTY_LONG_ARRAY
long
array.public static final Long[] EMPTY_LONG_OBJECT_ARRAY
Long
array.public static final int[] EMPTY_INT_ARRAY
int
array.public static final Integer[] EMPTY_INTEGER_OBJECT_ARRAY
Integer
array.public static final short[] EMPTY_SHORT_ARRAY
short
array.public static final Short[] EMPTY_SHORT_OBJECT_ARRAY
Short
array.public static final byte[] EMPTY_BYTE_ARRAY
byte
array.public static final Byte[] EMPTY_BYTE_OBJECT_ARRAY
Byte
array.public static final double[] EMPTY_DOUBLE_ARRAY
double
array.public static final Double[] EMPTY_DOUBLE_OBJECT_ARRAY
Double
array.public static final float[] EMPTY_FLOAT_ARRAY
float
array.public static final Float[] EMPTY_FLOAT_OBJECT_ARRAY
Float
array.public static final boolean[] EMPTY_BOOLEAN_ARRAY
boolean
array.public static final Boolean[] EMPTY_BOOLEAN_OBJECT_ARRAY
Boolean
array.public static Boolean[] toObject(boolean[] array)
This method returns null
for a null
input array.
array
- a boolean
arrayBoolean
array, null
if null array inputpublic static Byte[] toObject(byte[] array)
This method returns null
for a null
input array.
array
- a byte
arrayByte
array, null
if null array inputpublic static Double[] toObject(double[] array)
This method returns null
for a null
input array.
array
- a double
arrayDouble
array, null
if null array inputpublic static Float[] toObject(float[] array)
This method returns null
for a null
input array.
array
- a float
arrayFloat
array, null
if null array inputpublic static Integer[] toObject(int[] array)
This method returns null
for a null
input array.
array
- an int
arrayInteger
array, null
if null array inputpublic static Long[] toObject(long[] array)
This method returns null
for a null
input array.
array
- a long
arrayLong
array, null
if null array inputpublic static Short[] toObject(short[] array)
This method returns null
for a null
input array.
array
- a short
arrayShort
array, null
if null array inputpublic static boolean[] toPrimitiveBoolean(Object[] array)
This method returns null
for a null
input array.
array
- a Boolean
array, may be null
boolean
array, null
if null array inputNullPointerException
- if array content is null
public static byte[] toPrimitiveByte(Object[] array)
This method returns null
for a null
input array.
array
- a Byte
array, may be null
byte
array, null
if null array inputNullPointerException
- if array content is null
public static double[] toPrimitiveDouble(Object[] array)
This method returns null
for a null
input array.
array
- a Double
array, may be null
double
array, null
if null array inputNullPointerException
- if array content is null
public static float[] toPrimitiveFloat(Object[] array)
This method returns null
for a null
input array.
array
- a Float
array, may be null
float
array, null
if null array inputNullPointerException
- if array content is null
public static int[] toPrimitiveInteger(Object[] array)
This method returns null
for a null
input array.
array
- a Integer
array, may be null
int
array, null
if null array inputNullPointerException
- if array content is null
public static long[] toPrimitiveLong(Object[] array)
This method returns null
for a null
input array.
array
- a Long
array, may be null
long
array, null
if null array inputNullPointerException
- if array content is null
public static short[] toPrimitiveShort(Object[] array)
This method returns null
for a null
input array.
array
- a Short
array, may be null
byte
array, null
if null array inputNullPointerException
- if array content is null
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.