Here you can find the source of isIncluded(List
Parameter | Description |
---|---|
list | the list |
src | the src |
public static boolean isIncluded(List<String> list, String src)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**//from ww w . j a va 2 s. c o m * Checks if is included. * * @param list the list * @param src the src * @return true, if is included */ public static boolean isIncluded(List<String> list, String src) { return isIncluded(list, src, true); } /** * Checks if is included. * * @param list the list * @param src the src * @param strict the strict * @return true, if is included */ public static boolean isIncluded(List<String> list, String src, boolean strict) { if (list == null) return true; // filter by known source if if (strict) return list.contains(src); // else look at substring for (String s : list) { if (src.contains(s)) return true; } return false; } }