Class CollectionUtils
java.lang.Object
no.mnemonic.commons.utilities.collections.CollectionUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
isEmpty
(Collection<T> collection) Null-safe operation to test if a collection is empty.static int
size
(Collection collection) Null-safe operation to determine the size of a collection.
-
Method Details
-
isEmpty
Null-safe operation to test if a collection is empty.- Type Parameters:
T
- Type of collection elements.- Parameters:
collection
- Collection to be tested.- Returns:
- Returns true if the collection is null or contains no elements.
-
size
Null-safe operation to determine the size of a collection.- Parameters:
collection
- Collection to compute size for.- Returns:
- Returns 0 if the collection is null, otherwise the number of elements in the collection.
-