*/
package org.opendaylight.yangtools.yang.data.impl.schema.tree;
+import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
import java.util.Collection;
private TreeNode writtenOriginal;
// Internal cache for TreeNodes created as part of validation
- private SchemaAwareApplyOperation validatedOp;
+ private ModificationApplyOperation validatedOp;
private Optional<TreeNode> validatedCurrent;
- private TreeNode validatedNode;
+ private Optional<TreeNode> validatedNode;
private ModifiedNode(final PathArgument identifier, final Optional<TreeNode> original,
final ChildTrackingPolicy childPolicy) {
*
* @return Currently-written value
*/
+ @Nonnull
NormalizedNode<?, ?> getWrittenValue() {
- return value;
+ return verifyNotNull(value);
}
/**
/**
* Records a write for associated node.
*
- * @param value new value
+ * @param newValue new value
*/
- void write(final NormalizedNode<?, ?> value) {
- updateValue(LogicalOperation.WRITE, value);
+ void write(final NormalizedNode<?, ?> newValue) {
+ updateValue(LogicalOperation.WRITE, newValue);
children.clear();
}
* Update this node's value and operation type without disturbing any of its child modifications.
*
* @param type New operation type
- * @param value New node value
+ * @param newValue New node value
*/
- void updateValue(final LogicalOperation type, final NormalizedNode<?, ?> value) {
- this.value = requireNonNull(value);
+ void updateValue(final LogicalOperation type, final NormalizedNode<?, ?> newValue) {
+ this.value = requireNonNull(newValue);
updateOperationType(type);
}
return new ModifiedNode(metadataTree.getIdentifier(), Optional.of(metadataTree), childPolicy);
}
- void setValidatedNode(final SchemaAwareApplyOperation op, final Optional<TreeNode> current, final TreeNode node) {
+ void setValidatedNode(final ModificationApplyOperation op, final Optional<TreeNode> current,
+ final Optional<TreeNode> node) {
this.validatedOp = requireNonNull(op);
this.validatedCurrent = requireNonNull(current);
this.validatedNode = requireNonNull(node);
}
- TreeNode getValidatedNode(final SchemaAwareApplyOperation op, final Optional<TreeNode> current) {
+ Optional<TreeNode> getValidatedNode(final ModificationApplyOperation op, final Optional<TreeNode> current) {
return op.equals(validatedOp) && current.equals(validatedCurrent) ? validatedNode : null;
}
}