java stream map 作为参数
publicList
deleteBatch(List params, Function
paramsComparator, Function
comparator, List oldLevelList) { List deleteList = new ArrayList<>(); if (Func.isEmpty(oldLevelList)) { return deleteList; } deleteList = mapFunction(oldLevelList, comparator); List newTagIdList = params.stream().map(paramsComparator).filter(e -> Func.isNotEmpty(e)).collect(Collectors.toList()); deleteList.removeAll(newTagIdList); if (Func.isNotEmpty(deleteList)) { this.getBaseMapper().deleteBatchIds(deleteList); } return deleteList; } public List mapFunction(List tList, Function comparator) { return tList.stream().map(comparator).collect(Collectors.toList()); } @Override public Boolean updateBatch(List params, String configId) { if (Func.isEmpty(params)) { return deleteByConfigId(configId); } List oldLevelList = this.findLevelsByConfigId(configId); List deleteList = deleteBatch(params, EvalConfigLevelApiParam::getConfigId, EvalConfigLevel::getId, oldLevelList); List tags = convertToEvalConfigTagList(params, configId, deleteList); return this.saveOrUpdateBatch(tags); }