List of utility methods to do Collection Check
boolean | isCollectionType(Object obj) This method checks whether the JSON being parse is a container class. if (obj instanceof List<?>) { return true; } else if (obj instanceof Collection<?>) { return true; return false; |
boolean | isCollectionType(Object propertyValue) is Collection Type return propertyValue.getClass().isAssignableFrom(Collection.class) || Collection.class.isInstance(propertyValue); |
boolean | isCollectionType(Object value) is Collection Type return value instanceof Collection; |
boolean | isCollectionTypeHomogenous(final Collection collection, final Class expectedType) is Collection Type Homogenous for (final Object object : collection) { if (object == null) { continue; } else if (!expectedType.isAssignableFrom(object.getClass())) { return false; return true; ... |
boolean | isCompatibleTypes(Collection a, Collection b) is Compatible Types return isOrdered(a) == isOrdered(b);
|