public final class ArrayUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> T[] |
add(T[] array,
java.lang.Class<T> componentType,
T element)
Adds a specific element to a specific array with a specific component
type if the array does not contain the element yet.
|
static <T> T[] |
concat(T[] first,
T[] second)
Concatenates two arrays.
|
static <T> T[] |
insert(T element,
T[] array,
java.lang.Class<T> componentType)
Inserts the given element into an open (null) slot in the array if there
is one, otherwise creates a new array and adds all existing elements
and the given element
|
static <T> boolean |
isNullOrEmpty(T[] array)
Tests whether the array passed in as an argument is null or empty.
|
public static <T> T[] add(T[] array, java.lang.Class<T> componentType, T element)
array
- the array to add element tocomponentType
- the component type of arrayelement
- the element to add to arraypublic static <T> T[] insert(T element, T[] array, java.lang.Class<T> componentType)
T
- the type of the elementelement
- the element to addarray
- the array to add to, if possiblecomponentType
- the class type of the array (used if a new one
needs to be allocated)public static <T> T[] concat(T[] first, T[] second)
T
- first
- second
- public static <T> boolean isNullOrEmpty(T[] array)
T
- array
-
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.