类 TreeUtil

java.lang.Object
top.tangyh.basic.utils.TreeUtil

public final class TreeUtil extends Object
list列表 转换成tree列表 Created by Ace on 2017/6/12.
作者:
zuihou
  • 字段详细资料

    • TREE_SPLIT

      public static final String TREE_SPLIT
      默认的树节点 分隔符
      另请参阅:
    • DEF_PARENT_ID

      public static final Long DEF_PARENT_ID
      默认的父id
  • 方法详细资料

    • getTreePath

      public static String getTreePath(String parentTreePath, Long parentId)
    • buildTreePath

      public static String buildTreePath(Long id)
    • isRoot

      public static boolean isRoot(Long id)
      判断id是否为根节点
      参数:
      id -
      返回:
    • buildTree

      public static <E extends TreeEntity<E, ? extends Serializable>> List<E> buildTree(Collection<E> treeList)
      构建Tree结构
      参数:
      treeList - 待转换的集合
      返回:
      树结构
    • getTopNodeId

      public static Long getTopNodeId(String treePath)