List of utility methods to do Collection Empty
Collection | emptyToNull(final Collection If the given collection is empty null is returned. return value.isEmpty() ? null : value;
|
Collection | getSingletonCollectionOrEmptyIfNull(T o) get Singleton Collection Or Empty If Null if (o == null) return Collections.emptySet(); else return Collections.singleton(o); |
boolean | isAnyEmpty(Collection>... collections) is Any Empty if (collections == null) { return true; for (Collection<?> collection : collections) { if (isEmpty(collection)) { return true; return false; |
boolean | isCollectionEmpty(Collection collection) is Collection Empty boolean isEmpty = true; Iterator iterator = collection.iterator(); while (iterator.hasNext() && isEmpty) { Object object = iterator.next(); if (object != null) { isEmpty = false; return isEmpty; |
Boolean | isCollectionEmpty(Collection oneCol) is Collection Empty return (oneCol == null || oneCol.isEmpty() || oneCol.size() < 1);
|
boolean | isCollectionEmpty(Collection> value) is Collection Empty if (isNull(value)) { return true; return value.isEmpty(); |
boolean | isCollectionNotEmpty(Collection is Collection Not Empty return !isCollectionEmpty(collection);
|
boolean | isCollectionNullOrEmpty(Collection collection) is Collection Null Or Empty return collection == null || collection.isEmpty();
|
boolean | isEmpty(Collection c) Check whether collection c is empty. return ((c == null) || (c.size() == 0));
|
boolean | isEmpty(Collection c) is Empty return c == null || c.isEmpty();
|