Java Utililty Methods List Contain

List of utility methods to do List Contain

Description

The list of methods to do List Contain are organized into topic(s).

Method

booleanpathContains(List path, String source, String label, String target)
path Contains
for (int i = 0; i < path.size() - 2; i += 2) {
    if (path.get(i).equals(source)) {
        if (path.get(i + 1).equals(label) && path.get(i + 2).equals(target))
            return true;
return false;
ListreplaceWithList(List containingList, String key, List list)
replace With List
if (containingList == null) {
    throw new IllegalArgumentException("List<String> cannot be null");
if (key == null) {
    throw new IllegalArgumentException("String cannot be null");
if (list == null) {
    throw new IllegalArgumentException("List<String> cannot be null");
...
BooleanstrContainsbyList(String str, List filterList)
check each line whether contains special str
Boolean strFounded = false;
for (int i = 0; i < filterList.size(); i++) {
    if (str.contains(filterList.get(i))) {
        strFounded = true;
        break;
return strFounded;
...
booleanstringContains(String line, List list)
string Contains
for (String s : list)
    if (line.contains(s))
        return true;
return false;
booleanstringContainsItemFromList(String inputString, List items)
string Contains Item From List
for (String item : items) {
    if (inputString.contains(item)) {
        return true;
return false;
booleanstringsContainsQuery(String query, List args)
strings Contains Query
boolean result = false;
for (String field : args) {
    if (field != null && field.toUpperCase().contains(query.toUpperCase())) {
        result = true;
        break;
return result;
...