public class CollectionUtils extends Object
| Constructor and Description |
|---|
CollectionUtils()
|
| Modifier and Type | Method and Description |
|---|---|
static <E> List |
asList(E... elements)
|
static <E> Set |
asSet(E... elements)
|
static boolean |
isEmpty(Collection
|
static boolean |
isEmpty(Map
|
static boolean |
isEmpty(PrincipalCollection
|
static int |
size(Collection
Returns the size of the specified collection or
0 if the collection is
null.
|
static int |
size(Map
Returns the size of the specified map or
0 if the map is
null.
|
public static <E> Set<E> asSet(E... elements)
public static boolean isEmpty(Collectionc)
c - the collection to check
true if the specified
Collection is
null or
empty,
false otherwise.
public static boolean isEmpty(Mapm)
m - the
Map to check
true if the specified
Map is
null or
empty,
false otherwise.
public static int size(Collectionc)
0 if the collection is
null.
c - the collection to check
0 if the collection is
null.
public static int size(Mapm)
0 if the map is
null.
m - the map to check
0 if the map is
null.
public static boolean isEmpty(PrincipalCollectionprincipals)
principals - the principals to check.
true if the specified
PrincipalCollection is
null or
empty,
false otherwise.
public static <E> List<E> asList(E... elements)