Class IBaseTreeNodeHandlerExtensions
java.lang.Object
io.github.astrapi69.gen.tree.handler.IBaseTreeNodeHandlerExtensions
The class
IBaseTreeNodeHandlerExtensions provides handler methods for the class
IBaseTreeNode-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V,K, T extends IBaseTreeNode<V, K, T>>
TfindById(T treeNode, K id) Find the occurrence ofIBaseTreeNodeobject from the given key object that serves as the search targetstatic <V,K, T extends IBaseTreeNode<V, K, T>>
TmergeTreeNodes(T root, @NonNull List<T> treeNodes) Merge the given tree nodes with the given root tree nodestatic <V,K, T extends IBaseTreeNode<V, K, T>>
TmergeTreeNodes(T root, T... treeNodes) Merge the given tree nodes with the given root tree node
-
Constructor Details
-
IBaseTreeNodeHandlerExtensions
public IBaseTreeNodeHandlerExtensions()
-
-
Method Details
-
findById
Find the occurrence ofIBaseTreeNodeobject from the given key object that serves as the search target- Type Parameters:
V- the generic type of the valueK- the generic type of the id of the nodeT- the generic type of the concrete tree node- Parameters:
treeNode- the tree nodeid- the id for the search process- Returns:
- the first occurrence of
IBaseTreeNodeobject that have the same value as the given value
-
mergeTreeNodes
public static <V,K, T mergeTreeNodesT extends IBaseTreeNode<V, K, T>> (@NonNull T root, @NonNull @NonNull List<T> treeNodes) Merge the given tree nodes with the given root tree node- Type Parameters:
V- the generic type of the valueK- the generic type of the id of the nodeT- the generic type of the concrete tree node- Parameters:
root- the root tree nodetreeNodes- the tree nodes to merge with- Returns:
- the root with the merged tree nodes
-
mergeTreeNodes
public static <V,K, T mergeTreeNodesT extends IBaseTreeNode<V, K, T>> (@NonNull T root, T... treeNodes) Merge the given tree nodes with the given root tree node- Type Parameters:
V- the generic type of the valueK- the generic type of the id of the nodeT- the generic type of the concrete tree node- Parameters:
root- the root tree nodetreeNodes- the tree nodes to merge with- Returns:
- the root with the merged tree nodes
-