| 程序包 | 说明 |
|---|---|
| org.dromara.hutool.core.func |
函数封装
接口灵感来自于ActFramework 一个函数接口代表一个一个函数,用于包装一个函数为对象 在JDK8之前,Java的函数并不能作为参数传递,也不能作为返回值存在,此接口用于将一个函数包装成为一个对象,从而传递对象 |
| org.dromara.hutool.core.tree |
提供通用树生成,特点:
1、每个字段可自定义
2、支持排序 树深度配置,自定义转换器等 3、支持额外属性扩展 4、贴心 许多属性,特性都有默认值处理 5、使用简单 可一行代码生成树 6、代码简洁轻量无额外依赖 |
| 限定符和类型 | 方法和说明 |
|---|---|
default SerPredicate<T> |
SerPredicate.and(SerPredicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical
AND of this predicate and another.
|
static <T> SerPredicate<T> |
SerPredicate.isEqual(Object... targetRef)
Returns a predicate that tests if two arguments are equal according
to
Objects.equals(Object, Object). |
static <T> SerPredicate<T> |
SerPredicate.multiAnd(SerPredicate<T>... predicates)
multi
|
static <T> SerPredicate<T> |
SerPredicate.multiOr(SerPredicate<T>... predicates)
multi
|
default SerPredicate<T> |
SerPredicate.negate()
Returns a predicate that represents the logical negation of this
predicate.
|
default SerPredicate<T> |
SerPredicate.or(SerPredicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical
OR of this predicate and another.
|
| 限定符和类型 | 方法和说明 |
|---|---|
default SerPredicate<T> |
SerPredicate.and(SerPredicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical
AND of this predicate and another.
|
static <T> SerPredicate<T> |
SerPredicate.multiAnd(SerPredicate<T>... predicates)
multi
|
static <T> SerPredicate<T> |
SerPredicate.multiOr(SerPredicate<T>... predicates)
multi
|
default SerPredicate<T> |
SerPredicate.or(SerPredicate<? super T> other)
Returns a composed predicate that represents a short-circuiting logical
OR of this predicate and another.
|
| 限定符和类型 | 方法和说明 |
|---|---|
List<T> |
BeanTree.filter(List<T> tree,
SerPredicate<T> condition)
树的过滤操作,本方法一般适用于寻找某人所在部门以及所有上级部门类似的逻辑
通过
SerPredicate指定的过滤规则,本节点或子节点满足过滤条件,则保留当前节点,否则抛弃节点及其子节点即,一条路径上只要有一个节点符合条件,就保留整条路径上的节点 |
static <T,R extends Comparable<R>> |
BeanTree.ofMatch(SerFunction<T,R> idGetter,
SerFunction<T,R> pidGetter,
SerPredicate<T> parentPredicate,
SerFunction<T,List<T>> childrenGetter,
SerBiConsumer<T,List<T>> childrenSetter)
构建BeanTree
|
Copyright © 2024. All rights reserved.