Class PermittedSubclasses.HierarchyNode

java.lang.Object
cloud.opencode.base.reflect.sealed.PermittedSubclasses.HierarchyNode
Enclosing class:
PermittedSubclasses

public static class PermittedSubclasses.HierarchyNode extends Object
Hierarchy node for tree representation 用于树表示的层次结构节点
Since:
JDK 25, opencode-base-reflect V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • HierarchyNode

      public HierarchyNode(Class<?> clazz)
      Creates a HierarchyNode 创建HierarchyNode
      Parameters:
      clazz - the class | 类
  • Method Details

    • getClazz

      public Class<?> getClazz()
      Gets the class 获取类
      Returns:
      the class | 类
    • getChildren

      public List<PermittedSubclasses.HierarchyNode> getChildren()
      Gets child nodes 获取子节点
      Returns:
      list of children | 子节点列表
    • isLeaf

      public boolean isLeaf()
      Checks if this is a leaf node 检查是否为叶节点
      Returns:
      true if leaf | 如果是叶节点返回true
    • getDepth

      public int getDepth()
      Gets the depth of this node 获取此节点的深度
      Returns:
      the depth | 深度
    • getLeafClasses

      public List<Class<?>> getLeafClasses()
      Gets all leaf classes 获取所有叶类
      Returns:
      list of leaf classes | 叶类列表
    • toString

      public String toString()
      Overrides:
      toString in class Object