Java examples for java.util:List Value
Check if a list Contains a value
//package com.java2s; import java.util.List; public class Main { public static boolean listContains(List<String> list, String valueToFind) { if (list == null || valueToFind == null) { return false; }/*from ww w . j av a 2s. c o m*/ for (String item : list) { if (item != null && item.equals(valueToFind)) { return true; } } return false; } }