2 * Copyright (c) 2014 Cisco Systems, Inc. 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 com.google.common.base.Preconditions;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 * Client allocated result holder for {@link ImmutableNormalizedNodeStreamWriter}.
15 * which produces instance of NormalizedNode.
17 * Client may supply result holder to {@link ImmutableNormalizedNodeStreamWriter}
18 * which will be once updated, when result is available.
20 * This is intended for using {@link ImmutableNormalizedNodeStreamWriter}
21 * without supplying builder, so instantiated writer will select
22 * correct builder based on first event and sets resulting
23 * {@link NormalizedNode} when end event is invoked for node.
26 public class NormalizedNodeResult {
28 private boolean finished = false;
29 private NormalizedNode<?,?> result;
31 public NormalizedNode<?, ?> getResult() {
35 void setResult(final NormalizedNode<?, ?> result) {
36 Preconditions.checkState(!this.finished, "Result was already set.");
41 public boolean isFinished() {