Interface TreeMerger.MergeStrategy<T>

Type Parameters:
T - the node type | 节点类型
Enclosing class:
TreeMerger
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface TreeMerger.MergeStrategy<T>
Functional interface for resolving merge conflicts when a node exists in both forests. 当节点同时存在于两棵森林中时,用于解决合并冲突的函数式接口。
Since:
JDK 25, opencode-base-tree V1.0.3
Author:
Leon Soo www.LeonSoo.com
  • Method Summary

    Modifier and Type
    Method
    Description
    resolve(T left, T right)
    Resolves a conflict between left and right nodes with the same ID.
  • Method Details

    • resolve

      T resolve(T left, T right)
      Resolves a conflict between left and right nodes with the same ID. 解决具有相同ID的左右节点之间的冲突。
      Parameters:
      left - the node from the left forest | 左侧森林的节点
      right - the node from the right forest | 右侧森林的节点
      Returns:
      the resolved node | 解决后的节点