A node state diff handler that applies all reported changes as-is to the given node builder. No conflict detection or resolution is attempted. The main use case for this class is to call all the {@link NodeBuilder} methods necessary to go from a given base stateto any given target state.
The expected usage pattern looks like this:
NodeState base = ...; NodeState target = ...; NodeBuilder builder = base.builder(); target.compareAgainstBaseState(base, new ReapplyDiff(builder)); assertEquals(target, builder.getNodeState());
Alternatively, the {@link #apply(NodeState)} method can be used to setthe content of a given builder:
NodeBuilder builder = ...; NodeState target = ...; new ApplyDiff(builder).apply(target); assertEquals(target, builder.getNodeState());