Java List Contain containsOrIsEmpty(List list, Object item)

Here you can find the source of containsOrIsEmpty(List list, Object item)

Description

contains Or Is Empty

License

Apache License

Declaration

public static boolean containsOrIsEmpty(List<String> list, Object item) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static boolean containsOrIsEmpty(List<String> list, Object item) {
        if (list == null || list.isEmpty() || list.contains(item))
            return true;
        return false;
    }/*w  w  w.j av a 2  s  .  com*/

    public static boolean contains(List<String> list, String item) {
        if (list == null)
            return false;
        return list.contains(item);
    }
}

Related

  1. containsOneEqualElem(List first, List second)
  2. containsOnly(List elements, Class clazz)
  3. containsOnlyEmptyValues(List list)
  4. containsOnlyNulls(List list)
  5. containsOnlySequentialNumbers(List values)
  6. containsReference(List references, Object toBeFound)
  7. containsSameItemsInOrder(List col1, List col2)
  8. containsStr(List list, String str)
  9. containsStringStartingWith(List list, String prefix)