public class MergeCombiner extends NodeCombiner
A specialized implementation of the NodeCombiner interface
that performs a merge from two passed in node hierarchies.
This combiner performs the merge using a few rules:
HANDLER| Constructor and Description |
|---|
MergeCombiner() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAttributes(ImmutableNode.Builder result,
ImmutableNode node1,
ImmutableNode node2)
Handles the attributes during a combination process.
|
protected ImmutableNode |
canCombine(ImmutableNode node2,
ImmutableNode child,
List<ImmutableNode> children2)
Tests if the first node can be combined with the second node.
|
ImmutableNode |
combine(ImmutableNode node1,
ImmutableNode node2)
Combines the given nodes to a new union node.
|
addListNode, getListNodes, isListNodepublic ImmutableNode combine(ImmutableNode node1, ImmutableNode node2)
combine in class NodeCombinernode1 - the first source nodenode2 - the second source nodeprotected void addAttributes(ImmutableNode.Builder result, ImmutableNode node1, ImmutableNode node2)
result - the builder for the resulting nodenode1 - the first nodenode2 - the second nodeprotected ImmutableNode canCombine(ImmutableNode node2, ImmutableNode child, List<ImmutableNode> children2)
node2 - the second nodechild - the child node (of the first node)children2 - the children of the 2nd nodeCopyright © 2001–2020 The Apache Software Foundation. All rights reserved.