List of utility methods to do Collection Contain
boolean | containsNone(Collection contains None assert container != null; assert other != null; for (T t : other) { if (container.contains(t)) { return false; return true; ... |
void | containsNoNull(final Collection> c, final String s) Checks that the collection does not contain a null value (throws an IllegalArgumentException if it does). if (c.contains(null)) { throw new IllegalArgumentException(s); |
Collection | containsNoNulls(Collection contains No Nulls container = checkNotNull(container); for (T item : container) { if (item == null) { throw new NullPointerException("Container cannot contain null values"); return container; |
boolean | containsNull(Collection> collection) contains Null if (!isEmpty(collection)) { for (Object obj : collection) { if (obj == null) { return true; return false; ... |
boolean | containsNull(Collection Checks whether the collection contains a null value. for (Object object : args) { if (object == null) { return true; return false; |
boolean | containsNull(final Collection> c) contains Null synchronized (c) { for (final Object o : c) { if (o == null) return true; return false; |
boolean | containsNullsOrEmptyStrings(Collection Returns true if c contains empty Strings or null references. for (String s : c) { if (isEmptyOrNull(s)) { return true; return false; |
boolean | containsNumber(Collection contains Number Iterator<Number> iterator = collection.iterator(); while (iterator.hasNext()) { Number comparable = iterator.next(); if (comparable == null) return comparable == number; if (comparable.doubleValue() == number.doubleValue()) return true; return false; |
boolean | containsObject(Collection Checks whether a Collection contains a specified Object. for (Object o1 : c) { if (o == o1) { return true; return false; |
boolean | containsObjectIdentity(Collection Returns true if the given Collection contains the given object. return indexOfObjectIdentity(collection, object) >= 0;
|