public abstract class CollectionUtils extends Object
| 构造器和说明 |
|---|
CollectionUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <E> List<E> |
asList(E... elements) |
static <E> Set<E> |
asSet(E... elements) |
static boolean |
isEmpty(Collection<?> c)
|
static boolean |
isEmpty(Map<?,?> m)
|
static int |
size(Collection<?> c)
Returns the size of the specified collection or
0 if the collection
is null. |
static int |
size(Map<?,?> m)
Returns the size of the specified map or
0 if the map is
null. |
@SafeVarargs public static <E> Set<E> asSet(E... elements)
public static boolean isEmpty(Collection<?> c)
c - the collection to checktrue if the specified Collection is null or
empty, false otherwise.public static boolean isEmpty(Map<?,?> m)
m - the Map to checktrue if the specified Map is null or
empty, false otherwise.public static int size(Collection<?> c)
0 if the collection
is null.c - the collection to check0 if the collection
is null.public static int size(Map<?,?> m)
0 if the map is
null.m - the map to check0 if the map is
null.@SafeVarargs public static <E> List<E> asList(E... elements)
Copyright © 2021. All rights reserved.