完善 TreeBuilder。

This commit is contained in:
2023-07-19 01:25:21 +08:00
parent 47eb91d015
commit 201cf39e0c
2 changed files with 6 additions and 14 deletions

View File

@@ -35,7 +35,7 @@ class TreeBuilderTests {
menus,
Menu::getMenuCode,
Menu::getParentMenuCode,
Menu::addChild)
MenuList::addChild)
.buildTree();
log.info("menuTree: {}", menuTree);
}
@@ -64,8 +64,6 @@ abstract class Menu {
public String getTitle() {
return title;
}
public abstract void addChild(Menu child);
}
@ToString(callSuper = true)
@@ -89,12 +87,6 @@ class MenuItem extends Menu {
public String getUrl() {
return url;
}
@Override
@Deprecated
public void addChild(Menu child) {
throw new UnsupportedOperationException("Unimplemented method 'addChild'");
}
}
@ToString(callSuper = true)
@@ -126,7 +118,6 @@ class MenuList extends Menu {
return instance;
}
@Override
public void addChild(Menu child) {
if (this.children == null) {
this.children = Lists.newArrayList();