Java Utililty Methods Collection Check

List of utility methods to do Collection Check

Description

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

Method

booleanisa(Collection> types, Class type)
isa
for (Class<?> cur : types) {
    if (cur.isAssignableFrom(type)) {
        return true;
return false;
booleanisACollection(Object input)
is A Collection
return input instanceof Collection;
booleanisAllFalse(Collection booleans)
is All False
for (Boolean aBoolean : booleans) {
    if (aBoolean)
        return false;
return true;
booleanisArrayOrCollection(Class clazz)
is Array Or Collection
if (clazz.isArray())
    return true;
return Collection.class.isAssignableFrom(clazz);
booleanisArrayOrCollection(Object paramObj)
is Array Or Collection
if (paramObj == null) {
    return false;
if (paramObj instanceof Collection || paramObj.getClass().isArray()) {
    return true;
return false;
booleanisArrayOrCollection(Object v)
is Array Or Collection
return v != null && (v.getClass().isArray() || v instanceof Collection<?>);
booleanisArrayOrCollection(String type)
is Array Or Collection
return isCollection(type) || isArray(type);
booleanisAssignableFrom(final Collection> classes, final Class objectClass)
is Assignable From
for (final Class<?> allowedClass : classes) {
    if (allowedClass != null) {
        if (allowedClass.isAssignableFrom(objectClass)) {
            return true;
return false;
...
booleanisBlank(Collection coll)
is Blank
return (coll == null || coll.isEmpty());
booleanisBlank(Collection c)
is Blank
return c == null || c.isEmpty();