对象去重方法 public static Predicate distinctByKey(Function keyExtractor) { Map seen = new ConcurrentHashMap(); return t - seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; } 调用去重方法 //获取部门名称列表
public static调用去重方法Predicate distinctByKey(Function keyExtractor) { Map
//获取部门名称列表 ListstringList = inputContentList.stream(). filter(n -> StringUtils.isNotBlank(n.getContentUserDeptName())). filter(distinctByKey(o -> o.getContentUserDeptName())). map(EnterpriseContent::getContentUserDeptName).collect(Collectors.toList());