public class ZArrays
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T[] |
filter(T[] array,
java.util.function.Predicate<T> predicate)
Creates a new array containing only the values matching the given
predicate.
|
static <T> int |
indexOf(T[] array,
T value)
Find the first index of the given object in the array.
|
static <T> int |
lastIndexOf(T[] array,
T value)
Find the last index of the given object in the array.
|
static <T,R> R[] |
map(java.lang.Class<R> component,
T[] array,
Function<T,R> function)
Creates a new array, converting each value of the original value using
the mapping function.
|
public static <T> int indexOf(T[] array,
T value)
T - object typearray - haystackvalue - needlepublic static <T> int lastIndexOf(T[] array,
T value)
T - object typearray - haystackvalue - needlepublic static <T,R> R[] map(java.lang.Class<R> component,
T[] array,
Function<T,R> function)
T - original component typeR - resulting component typecomponent - component classarray - original arrayfunction - mapping functionpublic static <T> T[] filter(T[] array,
java.util.function.Predicate<T> predicate)
T - component typearray - original arraypredicate - predicate