Commit 7276fccb by 杨伟程

树形相关接口

parent 213fa963
...@@ -101,4 +101,20 @@ public class TreeUtil { ...@@ -101,4 +101,20 @@ public class TreeUtil {
return StreamUtil.join(new ArrayList<>(list), Function.identity()); return StreamUtil.join(new ArrayList<>(list), Function.identity());
} }
public static <T> void fillId(List<BiConsumer<T, String>> consumerList, T t, String path, int start) {
if (StringUtils.isBlank(path)) {
return;
}
String[] arr = path.split(",");
for (int i = start; i < arr.length; i++) {
consumerList.get(i - start).accept(t, arr[i - start]);
}
}
public static <T> void fillId(List<BiConsumer<T, String>> consumerList, T t, String path) {
fillId(consumerList, t, path, 0);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment