public class CollectionUtils extends Object
Constructor and Description |
---|
CollectionUtils() |
Modifier and Type | Method and Description |
---|---|
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 boolean |
isEmpty(PrincipalCollection principals)
Deprecated.
Use PrincipalCollection.isEmpty() directly.
|
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 . |
public CollectionUtils()
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
.@Deprecated public static boolean isEmpty(PrincipalCollection principals)
principals
- the principals to check.true
if the specified PrincipalCollection
is null
or
empty
, false
otherwise.Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.