init
This commit is contained in:
37
src/main/java/com/newyetai/common/util/TreeNode.java
Normal file
37
src/main/java/com/newyetai/common/util/TreeNode.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.newyetai.common.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 树型结构
|
||||
*
|
||||
* @param <I>
|
||||
* @author sr on 2019-12-11
|
||||
*/
|
||||
public interface TreeNode<I extends Serializable, T extends TreeNode> {
|
||||
|
||||
/**
|
||||
* id
|
||||
*
|
||||
* @return
|
||||
* @author sr on 2019-12-11
|
||||
*/
|
||||
I getId();
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*
|
||||
* @return
|
||||
* @author sr on 2019-12-11
|
||||
*/
|
||||
I getParentId();
|
||||
|
||||
/**
|
||||
* 添加子节点
|
||||
*
|
||||
* @param node
|
||||
* @author sr on 2019-12-11
|
||||
*/
|
||||
void addChildren(T node);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user