eb70bfaa987791827d53bba969a06dda178eeebd
[yangtools.git] / yang / 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 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
11
12 /**
13  * Interface holding the common trait of {@link LeafSetEntryNode} and {@link LeafNode}, which both hold a value.
14  *
15  * @author Robert Varga
16  *
17  * @param <K> Local identifier of node
18  * @param <V> Value of node
19  */
20 public interface ValueNode<K extends PathArgument, V> extends NormalizedNode<K, V> {
21     /**
22      * Returns value of held by this node.
23      *
24      * <h3>Implementation notes</h3> Invocation of {@link #getValue()} must
25      * provides same value as value in {@link #getIdentifier()}.
26      * <code>true == this.getIdentifier().getValue().equals(this.getValue())</code>
27      *
28      * @return Returned value of this node. Value SHOULD meet criteria
29      *         defined by schema.
30      *
31      */
32     @Override
33     V getValue();
34 }