Android Utililty Methods Collection Empty Check

List of utility methods to do Collection Empty Check

Description

The list of methods to do Collection Empty Check are organized into topic(s).

Method

booleanisEmpty(Collection c)
is null or its size is 0
 isEmpty(null)   =   true; isEmpty({})     =   true; isEmpty({1})    =   false; 
return (c == null || c.size() == 0);
booleanisEmpty(final Collection collection)
is Empty
if (collection == null) {
    return true;
return collection.isEmpty();
booleanisNotEmpty(Collection collection)
Checks if provided Collection is null and not empty.
return (collection != null && collection.size() > 0);
booleanisNotEmpty(Collection list)
is Not Empty
return !isEmpty(list);
booleanisNotNull(Collection coll)
is Not Null
return !isNull(coll);
booleanisNotNull(Collection collection)
is Not Null
if (collection != null && collection.size() > 0) {
    return true;
return false;
booleanisNull(Collection coll)
is Null
if (coll == null) {
    return true;
if (coll.size() == 0) {
    return true;
return false;
booleanisNullOrEmpty(Collection collection)
is Null Or Empty
if (collection == null || collection.isEmpty()) {
    return true;
return false;
booleanisEmpty(Collection collection)
Is the provided collection null or empty?
return collection == null || collection.isEmpty();
booleanisEmpty(Collection collection)
*
return null == collection || collection.isEmpty();