标签:The equals bsp 实现 class getchild turn str bool
List<Resource> tree = new ArrayList<>(); for (Resource child : list) { boolean mark = false; for (Resource father : list) { if (StringKit.isNotBlank(child.getPid()) && child.getPid().equals(father.getId())) { mark = true; if (father.getChildren() == null) { father.setChildren(new ArrayList<>()); } father.getChildren().add(child); break; } } if (!mark) { tree.add(child); } } return tree;
标签:The equals bsp 实现 class getchild turn str bool
原文地址:https://www.cnblogs.com/yang21/p/9849675.html