Package org.miaixz.bus.core.tree
Class TreeNode<T>
java.lang.Object
org.miaixz.bus.core.tree.TreeNode<T>
- Type Parameters:
T- ID类型
- All Implemented Interfaces:
Serializable,Comparable<Node<T>>,Node<T>
树节点 每个属性都可以在
NodeConfig中被重命名
在你的项目里它可以是部门实体、地区实体等任意类树节点实体
类树节点实体: 包含key,父Key.不限于这些属性的可以构造成一颗树的实体对象- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetExtra()获取扩展字段getId()获取IDgetName()获取节点标签名称获取父节点IDComparable<?> 获取权重inthashCode()设置扩展字段设置IDsetName(CharSequence name) 设置节点标签名称setParentId(T parentId) 设置父节点IDsetWeight(Comparable<?> weight) 设置权重
-
Constructor Details
-
TreeNode
public TreeNode()空构造 -
TreeNode
构造- Parameters:
id- IDparentId- 父节点IDname- 名称weight- 权重
-
-
Method Details
-
getId
Description copied from interface:Node获取ID -
setId
Description copied from interface:Node设置ID -
getParentId
Description copied from interface:Node获取父节点ID- Specified by:
getParentIdin interfaceNode<T>- Returns:
- 父节点ID
-
setParentId
Description copied from interface:Node设置父节点ID- Specified by:
setParentIdin interfaceNode<T>- Parameters:
parentId- 父节点ID- Returns:
- this
-
getName
Description copied from interface:Node获取节点标签名称 -
setName
Description copied from interface:Node设置节点标签名称 -
getWeight
Description copied from interface:Node获取权重 -
setWeight
Description copied from interface:Node设置权重 -
getExtra
获取扩展字段- Returns:
- 扩展字段Map
-
setExtra
设置扩展字段- Parameters:
extra- 扩展字段- Returns:
- this
-
equals
-
hashCode
public int hashCode()
-