mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
Update hutool-core/src/main/java/cn/hutool/core/tree/BeanTree.java
This commit is contained in:
parent
720476f95c
commit
01bc7e6c16
@ -129,7 +129,7 @@ public class BeanTree<T, R extends Comparable<R>> {
|
|||||||
}
|
}
|
||||||
if (Objects.isNull(parentPredicate)) {
|
if (Objects.isNull(parentPredicate)) {
|
||||||
final Map<R, List<T>> pIdValuesMap = EasyStream.of(list)
|
final Map<R, List<T>> pIdValuesMap = EasyStream.of(list)
|
||||||
.peek(e -> Objects.requireNonNull(idGetter.apply(e), "The id of tree node must not be null")
|
.peek(e -> Assert.notNull(idGetter.apply(e), "The id of tree node must not be null {}", e))
|
||||||
).group(pidGetter);
|
).group(pidGetter);
|
||||||
final List<T> parents = pIdValuesMap.getOrDefault(pidValue, new ArrayList<>());
|
final List<T> parents = pIdValuesMap.getOrDefault(pidValue, new ArrayList<>());
|
||||||
findChildren(list, pIdValuesMap);
|
findChildren(list, pIdValuesMap);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user