public class ArrayUtil
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Constructor and Description |
---|
ArrayUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> T[] |
add(T[] array1,
T[] array2)
Add arrays
|
static <T> T[] |
addToArray(T[] array,
T item,
java.lang.Class<?> type)
Add element to an array
|
static <E> java.util.List<E> |
asMutableList(E[] array) |
static <T> T[] |
prependToArray(T item,
T[] array,
java.lang.Class<?> type)
Add element to the start of an array
|
static <T> T[] |
removeFromArray(T[] array,
java.lang.Object item) |
static <T> T[] |
removeNulls(T[] array) |
public static <T> T[] removeFromArray(T[] array, java.lang.Object item)
public static <T> T[] add(T[] array1, T[] array2)
T
- the array entry typearray1
- An array to add to (or null)array2
- An array to add to (or null)public static <T> T[] addToArray(T[] array, T item, java.lang.Class<?> type)
T
- the array entry typearray
- The array to add to (or null)item
- The item to addtype
- The type of the array (in case of null array)public static <T> T[] prependToArray(T item, T[] array, java.lang.Class<?> type)
T
- the array entry typearray
- The array to add to (or null)item
- The item to addtype
- The type of the array (in case of null array)public static <E> java.util.List<E> asMutableList(E[] array)
E
- the array entry typearray
- Any array of objectarray
.public static <T> T[] removeNulls(T[] array)
Copyright © 1995–2023 Webtide. All rights reserved.