- this.value = value;
- }
-
- void merge(final NormalizedNode<?, ?> value) {
- clearSnapshot();
- updateModificationType(ModificationType.MERGE);
-
- /*
- * Blind overwrite of any previous data is okay, no matter whether the node
- * is simple or complex type.
- *
- * If this is a simple or complex type with unkeyed children, this merge will
- * be turned into a write operation, overwriting whatever was there before.
- *
- * If this is a container with keyed children, there are two possibilities:
- * - if it existed before, this value will never be consulted and the children
- * will get explicitly merged onto the original data.
- * - if it did not exist before, this value will be used as a seed write and
- * children will be merged into it.
- * In either case we rely on OperationWithModification to manipulate the children
- * before calling this method, so unlike a write we do not want to clear them.
- */
- this.value = value;