2 * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.impl.schema;
10 import static java.util.Objects.requireNonNull;
12 import java.util.Collection;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeBuilder;
17 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeContainerBuilder;
19 @SuppressWarnings("rawtypes")
20 final class NormalizedNodeResultBuilder implements NormalizedNodeContainerBuilder {
21 private final @NonNull NormalizedNodeResult result;
23 NormalizedNodeResultBuilder() {
24 this.result = new NormalizedNodeResult();
27 NormalizedNodeResultBuilder(final NormalizedNodeResult result) {
28 this.result = requireNonNull(result);
31 @NonNull NormalizedNodeResult result() {
36 public NormalizedNodeBuilder withValue(final Object value) {
37 throw new UnsupportedOperationException();
41 public NormalizedNodeContainerBuilder withValue(final Collection value) {
42 throw new UnsupportedOperationException();
46 public NormalizedNode build() {
47 throw new IllegalStateException("Can not close NormalizedNodeResult");
51 public NormalizedNodeContainerBuilder withNodeIdentifier(final PathArgument nodeIdentifier) {
52 throw new UnsupportedOperationException();
56 public NormalizedNodeContainerBuilder addChild(final NormalizedNode child) {
57 result.setResult(child);
62 public NormalizedNodeContainerBuilder removeChild(final PathArgument key) {
63 throw new UnsupportedOperationException();