Java Utililty Methods Collection Null

List of utility methods to do Collection Null

Description

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

Method

booleanisEmplyOrNull(Collection collection)
is Emply Or Null
if (collection == null || collection.size() <= 0) {
    return true;
return false;
booleanisNotNull(Collection collection)
is Not Null
return !isNull(collection);
booleanisNull(Collection collection)
is Null
if (collection == null || collection.size() == 0) {
    return true;
return false;
booleanisNull(Collection collection)
is Null
return collection == null || collection.isEmpty();
booleanisNull(Collection c)
is Null
return null == c;
booleanisNull(Collection collection)
Determines whether or not an Collection contains only null elements.
return collection.stream().allMatch(e -> e == null);
booleanisNull(Collection collection)
is Null
if (collection == null || collection.isEmpty()) {
    return true;
return false;
booleanisNull(Collection collection)
Returns true if the collection is null or empty
return ((collection == null) || (collection.isEmpty()));
CollectionnullSafe(Collection collection)
null Safe
return collection == null ? Collections.emptyList() : collection;
CollectionnullSafe(Collection collection)
null Safe
return collection == null ? Collections.<T>emptyList() : collection;