Package jetbrains.buildServer.web.util
Class HierarchyBean<T>
- java.lang.Object
-
- jetbrains.buildServer.web.util.HierarchyBean<T>
-
- Type Parameters:
T
- type of nodes in hierarchy
- Direct Known Subclasses:
ProjectHierarchyBean
public class HierarchyBean<T> extends Object
Bean representing node of tree-like hierarchy and assumed to be used to display such hierarchies. List of these beans represents hierarchy tree - each bean knows its depth and can be placed in UI with offset depending on this depth.- Since:
- 9.0
- Author:
- Dmitry.Treskunov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
HierarchyBean.BeanCreator<I,B extends HierarchyBean<I>>
-
Constructor Summary
Constructors Modifier Constructor Description protected
HierarchyBean(T node)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <I> List<HierarchyBean<I>>
buildFor(List<I> items, boolean alreadySorted, TreeHierarchyComparator<I> comparator)
static <B extends HierarchyBean<I>,I>
List<B>buildFor(List<I> items, HierarchyBean.BeanCreator<I,B> creator, boolean alreadySorted, TreeHierarchyComparator<I> comparator)
Create list ofHierarchyBean
.int
getDepth()
int
getLimitedDepth()
static int
getLimitedDepth(int depth)
T
getNode()
protected void
setDepth(int depth)
String
toString()
-
-
-
Field Detail
-
MAX_DEPTH
public static final int MAX_DEPTH
- See Also:
- Constant Field Values
-
myDepth
protected int myDepth
-
-
Constructor Detail
-
HierarchyBean
protected HierarchyBean(T node)
-
-
Method Detail
-
getNode
public T getNode()
-
getDepth
public int getDepth()
-
getLimitedDepth
public int getLimitedDepth()
-
getLimitedDepth
public static int getLimitedDepth(int depth)
-
setDepth
protected void setDepth(int depth)
-
buildFor
@NotNull public static <I> List<HierarchyBean<I>> buildFor(@NotNull List<I> items, boolean alreadySorted, @NotNull TreeHierarchyComparator<I> comparator)
-
buildFor
@NotNull public static <B extends HierarchyBean<I>,I> List<B> buildFor(@NotNull List<I> items, @NotNull HierarchyBean.BeanCreator<I,B> creator, boolean alreadySorted, @NotNull TreeHierarchyComparator<I> comparator)
Create list ofHierarchyBean
. Such list represents tree-like hierarchy: - items are ordered in the way allowing to display them on UI using foreach loop (parents precede children) - each item knows its depths, that can be used as offset to display this item.
-
-