String flag;
1.判断list中是否包含某个字符串 List<String> menuTreeTypes = proMenuService.getMenuTreeTypes(emp.getEmpId()); boolean contains = menuTreeTypes.contains(flag); 2.判断数组中是否包含某个字符串 String[] empTypes = empType.split(","); boolean contains = Arrays.asList(empTypes).contains(flag);