public class ArrayUtils extends Object
Modifier and Type | Method and Description |
---|---|
static List<Boolean> |
asList(boolean... array)
Returns a
List backed by array . |
static List<Byte> |
asList(byte... array)
Returns a
List backed by array . |
static List<Character> |
asList(char... array)
Returns a
List backed by array . |
static List<Double> |
asList(double... array)
Returns a
List backed by array . |
static List<Float> |
asList(float... array)
Returns a
List backed by array . |
static List<Integer> |
asList(int... array)
Returns a
List backed by array . |
static List<Long> |
asList(long... array)
Returns a
List backed by array . |
static List<Short> |
asList(short... array)
Returns a
List backed by array . |
static <T> List<T> |
asList(T... array)
Returns a
List backed by array . |
static Boolean[] |
box(boolean[] array)
Returns a new array with the boxed values of
array . |
static Byte[] |
box(byte[] array)
Returns a new array with the boxed values of
array . |
static Character[] |
box(char[] array)
Returns a new array with the boxed values of
array . |
static Double[] |
box(double[] array)
Returns a new array with the boxed values of
array . |
static Float[] |
box(float[] array)
Returns a new array with the boxed values of
array . |
static Integer[] |
box(int[] array)
Returns a new array with the boxed values of
array . |
static Long[] |
box(long[] array)
Returns a new array with the boxed values of
array . |
static Short[] |
box(short[] array)
Returns a new array with the boxed values of
array . |
static boolean[] |
unbox(Boolean[] array)
Returns a new array with the unboxed values of
array . |
static byte[] |
unbox(Byte[] array)
Returns a new array with the unboxed values of
array . |
static char[] |
unbox(Character[] array)
Returns a new array with the unboxed values of
array . |
static double[] |
unbox(Double[] array)
Returns a new array with the unboxed values of
array . |
static float[] |
unbox(Float[] array)
Returns a new array with the unboxed values of
array . |
static int[] |
unbox(Integer[] array)
Returns a new array with the unboxed values of
array . |
static long[] |
unbox(Long[] array)
Returns a new array with the unboxed values of
array . |
static short[] |
unbox(Short[] array)
Returns a new array with the unboxed values of
array . |
public static Byte[] box(byte[] array)
array
.array
- the array to create a boxed array forIllegalArgumentException
- if array
is null
public static Short[] box(short[] array)
array
.array
- the array to create a boxed array forIllegalArgumentException
- if array
is null
public static Integer[] box(int[] array)
array
.array
- the array to create a boxed array forIllegalArgumentException
- if array
is null
public static Long[] box(long[] array)
array
.array
- the array to create a boxed array forIllegalArgumentException
- if array
is null
public static Float[] box(float[] array)
array
.array
- the array to create a boxed array forIllegalArgumentException
- if array
is null
public static Double[] box(double[] array)
array
.array
- the array to create a boxed array forIllegalArgumentException
- if array
is null
public static Character[] box(char[] array)
array
.array
- the array to create a boxed array forIllegalArgumentException
- if array
is null
public static Boolean[] box(boolean[] array)
array
.array
- the array to create a boxed array forIllegalArgumentException
- if array
is null
public static byte[] unbox(Byte[] array)
array
.array
- the array to create an unboxed array forIllegalArgumentException
- if array
or any element is
null
public static short[] unbox(Short[] array)
array
.array
- the array to create an unboxed array forIllegalArgumentException
- if array
or any element is
null
public static int[] unbox(Integer[] array)
array
.array
- the array to create an unboxed array forIllegalArgumentException
- if array
or any element is
null
public static long[] unbox(Long[] array)
array
.array
- the array to create an unboxed array forIllegalArgumentException
- if array
or any element is
null
public static float[] unbox(Float[] array)
array
.array
- the array to create an unboxed array forIllegalArgumentException
- if array
or any element is
null
public static double[] unbox(Double[] array)
array
.array
- the array to create an unboxed array forIllegalArgumentException
- if array
or any element is
null
public static char[] unbox(Character[] array)
array
.array
- the array to create an unboxed array forIllegalArgumentException
- if array
or any element is
null
public static boolean[] unbox(Boolean[] array)
array
.array
- the array to create an unboxed array forIllegalArgumentException
- if array
or any element is
null
@SafeVarargs public static <T> List<T> asList(T... array)
List
backed by array
. Any changes to the
List
will be made to array
. The List
has a
fixed size, so any operations that modify the size will throw
UnsupportedOperationException
.T
- the type of array
and the returned List
array
- the array to create a List
forList
backed by array
IllegalArgumentException
- if array
is null
@SafeVarargs public static List<Byte> asList(byte... array)
List
backed by array
. Any changes to the
List
will be made to array
. The List
has a
fixed size, so any operations that modify the size will throw
UnsupportedOperationException
.array
- the array to create a List
forList
backed by array
IllegalArgumentException
- if array
is null
@SafeVarargs public static List<Short> asList(short... array)
List
backed by array
. Any changes to the
List
will be made to array
. The List
has a
fixed size, so any operations that modify the size will throw
UnsupportedOperationException
.array
- the array to create a List
forList
backed by array
IllegalArgumentException
- if array
is null
@SafeVarargs public static List<Integer> asList(int... array)
List
backed by array
. Any changes to the
List
will be made to array
. The List
has a
fixed size, so any operations that modify the size will throw
UnsupportedOperationException
.array
- the array to create a List
forList
backed by array
IllegalArgumentException
- if array
is null
@SafeVarargs public static List<Long> asList(long... array)
List
backed by array
. Any changes to the
List
will be made to array
. The List
has a
fixed size, so any operations that modify the size will throw
UnsupportedOperationException
.array
- the array to create a List
forList
backed by array
IllegalArgumentException
- if array
is null
@SafeVarargs public static List<Float> asList(float... array)
List
backed by array
. Any changes to the
List
will be made to array
. The List
has a
fixed size, so any operations that modify the size will throw
UnsupportedOperationException
.array
- the array to create a List
forList
backed by array
IllegalArgumentException
- if array
is null
@SafeVarargs public static List<Double> asList(double... array)
List
backed by array
. Any changes to the
List
will be made to array
. The List
has a
fixed size, so any operations that modify the size will throw
UnsupportedOperationException
.array
- the array to create a List
forList
backed by array
IllegalArgumentException
- if array
is null
@SafeVarargs public static List<Character> asList(char... array)
List
backed by array
. Any changes to the
List
will be made to array
. The List
has a
fixed size, so any operations that modify the size will throw
UnsupportedOperationException
.array
- the array to create a List
forList
backed by array
IllegalArgumentException
- if array
is null
@SafeVarargs public static List<Boolean> asList(boolean... array)
List
backed by array
. Any changes to the
List
will be made to array
. The List
has a
fixed size, so any operations that modify the size will throw
UnsupportedOperationException
.array
- the array to create a List
forList
backed by array
IllegalArgumentException
- if array
is null
Copyright © 2022 Frostphyr. All rights reserved.