+
+ @Nullable DataSchemaContextNode<?> childSchema(final PathArgument child) {
+ if (schemaNode == null) {
+ return null;
+ }
+
+ checkState(builder instanceof NormalizedNodeContainerBuilder,
+ "Attempted to lookup child %s in non-container %s", schemaNode);
+ return schemaNode.getChild(child);
+ }
+
+ NormalizedNode<?, ?> build() {
+ return builder.build();
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ void addChild(final NormalizedNode<?, ?> child) {
+ checkState(builder instanceof NormalizedNodeContainerBuilder,
+ "Attempted to add child %s to non-container builder %s", child, builder);
+ ((NormalizedNodeContainerBuilder) builder).addChild(child);
+ }
+
+ @SuppressWarnings("unchecked")
+ void setValue(final Object value) {
+ checkState(!(builder instanceof NormalizedNodeContainerBuilder),
+ "Attempted to set value %s on container builder %s", value, builder);
+ builder.withValue(value);
+ }