List of utility methods to do List Contain
Object | getListValue(Object container, int index) get List Value if (container instanceof List) { List<?> list = (List<?>) container; if (list.size() > index) { return list.get(index); } else { throw new RuntimeException("List has insufficient size, index = " + index); } else if (container.getClass().isArray()) { ... |
boolean | identityContains(Object o, List> list) Check if o is in list with == operator for (Object l : list) { if (o == l) return true; return false; |
int | indexOfLineContaining(List index Of Line Containing s = stripSpaces(s); for (int i = 0; i < lines.size(); i++) { if (stripSpaces(lines.get(i)).contains(s)) { return i; return -1; |
boolean | isContain(List is Contain return !isCollectionEmpty(list) && i != null && Collections.binarySearch(list, i) >= 0;
|
boolean | isContainedInAll(String keyToSearch, List is Contained In All for (Set<String> otherEquivalenceClassesOID : list) { if (!otherEquivalenceClassesOID.contains(keyToSearch)) { return false; return true; |
boolean | isContains(final Object value, final Object... list) is Contains return stream(list).anyMatch(it -> Objects.equals(value, it));
|
boolean | isContains(List roles, String role, String module) is Contains if (roles.contains(module.toLowerCase() + ":" + role)) { return true; return false; |
boolean | isEitherContains(List is Either Contains if (!isAllNotNull(one, two)) return true; List<T> longer = one.size() > two.size() ? one : two; List<T> shorter = one.size() > two.size() ? two : one; boolean contains = true; for (T t : shorter) { if (!longer.contains(t)) { contains = false; ... |
boolean | isListContainAll(List is List Contain All boolean result = true; if (list.size() > 0 && checkItems.length > 0) { for (T t : checkItems) { if (!list.contains(t)) { result = false; break; } else { result = false; return result; |
Boolean | isListContainsDuplicateElement(List oneList) is List Contains Duplicate Element Boolean containsDuplicateElement = false; for (Integer i = 0; i < oneList.size() - 1; i++) { for (Integer j = i + 1; j < oneList.size(); j++) { if (oneList.get(i).equals(oneList.get(j))) { return true; return containsDuplicateElement; |