public final class ListFunctions extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> ArrayList<T> |
copy(List<T> list,
int extraCapacity)
Returns a copy of the specified list and leaves the specified extra capacity.
|
static <T> List<T> |
emptyToNull(List<T> list)
Returns the specified list if is contains any elements, or
null if the list is empty. |
static <T> boolean |
isNullOrEmpty(List<T> list)
Returns true if the specified list is
null or contains no elements. |
@Nonnull public static <T> ArrayList<T> copy(List<T> list, int extraCapacity)
T - the type of elementslist - the list to be copiedextraCapacity - the amount of space capacity requiredpublic static <T> List<T> emptyToNull(List<T> list)
null if the list is empty.T - the type of elementslist - the list to be checkedpublic static <T> boolean isNullOrEmpty(List<T> list)
null or contains no elements.T - the type of elementslist - the list to be checkedCopyright © 2016–2021 EntIT Software LLC, a Micro Focus company. All rights reserved.