public final class CollectionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static BitSet |
bitSetOf(int... values) |
static <E> ArrayList<E> |
copyOf(List<E> list)
Null-safe method for copying a
List. |
static <K,V> HashMap<K,V> |
copyOf(Map<K,V> map)
Null-safe method for copying a
Map. |
static <E> HashSet<E> |
copyOf(Set<E> set)
Null-safe method for copying a
Set. |
static <T> List<T> |
listOf(List<? extends T>... lists)
Creates an unmodifiable and efficient (for
RandomAccess lists) List which is the concatenation of
several other Lists. |
static int |
max(int[] values)
Returns the highest value from an array of
ints, or Integer.MIN_VALUE if the array is empty. |
static <T> List<T> |
nullAnd(Collection<T> collection)
Prepends a
null to a collection. |
static int |
unsignedMax(byte[] values)
Returns the highest value from an array of
bytes, interpreted as unsigned values, or
Integer.MIN_VALUE if the array is empty. |
static int |
unsignedMax(short[] values)
Returns the highest value from an array of
shorts, interpreted as unsigned values, or
Integer.MIN_VALUE if the array is empty. |
public static BitSet bitSetOf(int... values)
@SafeVarargs public static <T> List<T> listOf(List<? extends T>... lists)
RandomAccess lists) List which is the concatenation of
several other Lists.public static int max(int[] values)
ints, or Integer.MIN_VALUE if the array is empty.public static int unsignedMax(short[] values)
shorts, interpreted as unsigned values, or
Integer.MIN_VALUE if the array is empty.public static int unsignedMax(byte[] values)
bytes, interpreted as unsigned values, or
Integer.MIN_VALUE if the array is empty.public static <T> List<T> nullAnd(Collection<T> collection)
null to a collection.T - The type of collection.collection - The collection to which to prepend a null.null and then the contents of collection.public static <E> ArrayList<E> copyOf(List<E> list)
List.E - The element type of the list.list - The list to copy.ArrayList with the contents of the provided list, or null if list was null.public static <E> HashSet<E> copyOf(Set<E> set)
Set.E - The element type of the set.set - The set to copy.HashSet with the contents of the provided set, or null if set was null.Copyright © 2011–2023 pepsoft.org. All rights reserved.