# 函数式编程 + 接口+泛型 实现通用 树状数组(项目必备) **Repository Path**: baichen9187/treeUtil ## Basic Information - **Project Name**: 函数式编程 + 接口+泛型 实现通用 树状数组(项目必备) - **Description**: 函数式编程 + 接口+泛型 实现通用 树状数组(项目必备) - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 2 - **Created**: 2021-07-30 - **Last Updated**: 2023-11-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: utils, Java ## README # 函数式编程 + 接口+泛型 实现通用 树状数组(项目必备) ## 使用教程 ``` List list = biliTypesMapper.selectList( new LambdaQueryWrapper<>()); ITreeUtil treeUtil = new ITreeUtil<>(list); treeUtil.setCodeFunc(BiliTypes::getId); treeUtil.setParentFunc(BiliTypes::getParent); treeUtil.setListFunc(BiliTypes::getChildren); treeUtil.setConsumer(BiliTypes::setChildren); List tree = treeUtil.getTreeList(list.stream().filter(item->item.getParent().equals(0)).collect(Collectors.toList())); ```