Seal ValueNode
[yangtools.git] / data / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / ValueNode.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.data.api.schema;
9
10 /**
11  * Interface holding the common trait of {@link LeafSetEntryNode} and {@link LeafNode}, which both hold a value.
12  *
13  * @param <V> Value of node, which needs to be a well-published simple value type.
14  */
15 public sealed interface ValueNode<V> extends NormalizedNode permits LeafNode, LeafSetEntryNode {
16     /**
17      * {@inheritDoc}
18      *
19      * <p>
20      * <b>Implementation note</b>
21      * Invocation of {@code body()} must provide the same value as value in {@link #getIdentifier()}.
22      * {@code true == this.getIdentifier().getValue().equals(this.body())}.
23      */
24     @Override
25     V body();
26 }