@InterfaceAudience.Private public class CollectionUtils extends Object
Modifier and Type | Field and Description |
---|---|
private static List<Object> |
EMPTY_LIST |
Constructor and Description |
---|
CollectionUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
getFirst(Collection<T> collection)
first/last
|
static <T> T |
getLast(List<T> list) |
static int |
getLastIndex(List<?> list) |
static <T> boolean |
isEmpty(Collection<T> collection)
empty
|
static boolean |
isLastIndex(List<?> list,
int index) |
static <T> boolean |
notEmpty(Collection<T> collection) |
static <T> Collection<T> |
nullSafe(Collection<T> in) |
static <A,B> boolean |
nullSafeSameSize(Collection<A> a,
Collection<B> b) |
static <T> int |
nullSafeSize(Collection<T> collection)
size
|
public static <T> Collection<T> nullSafe(Collection<T> in)
public static <T> int nullSafeSize(Collection<T> collection)
public static <A,B> boolean nullSafeSameSize(Collection<A> a, Collection<B> b)
public static <T> boolean isEmpty(Collection<T> collection)
public static <T> boolean notEmpty(Collection<T> collection)
public static <T> T getFirst(Collection<T> collection)
public static int getLastIndex(List<?> list)
list
- any listpublic static boolean isLastIndex(List<?> list, int index)
list
- index
- the index in questionpublic static <T> T getLast(List<T> list)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.