52e5937b9065155537eb9195e2b74fb006b303c9
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / NormalizedNodeContainer.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
3  * This program and the accompanying materials are made available under the
4  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
5  * and is available at http://www.eclipse.org/legal/epl-v10.html
6  */
7 package org.opendaylight.yangtools.yang.data.api.schema;
8
9 import com.google.common.base.Optional;
10 import java.util.Collection;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
12
13 /**
14  * Node which is not leaf, but has child {@link NormalizedNode}s as its valzue.
15  *
16  *
17  * NormalizedNodeContainer does not have a value, but it has a child
18  * nodes. Definition of possible and valid child nodes is introduced
19  * in subclasses of this interface.
20  *
21  * This interface should not be used directly, but rather use of of derived subinterfaces
22  * such as {@link DataContainerNode}, {@link MapNode}, {@link LeafSetNode}.
23  *
24  * @param <I>
25  *            Node Identifier type
26  * @param <K>
27  *            Child Node Identifier type
28  * @param <V>
29  *            Child Node type
30  */
31 public interface NormalizedNodeContainer<I extends PathArgument, K extends PathArgument, V extends NormalizedNode<? extends K, ?>>
32         extends NormalizedNode<I, Collection<V>> {
33
34     @Override
35     I getIdentifier();
36
37     /**
38      * Returns immutable iteration of child nodes of this node.
39      *
40      */
41     @Override
42     Collection<V> getValue();
43
44     /**
45      * Returns child node identified by provided key.
46      *
47      * @param child
48      *            Path argument identifying child node
49      * @return Optional with child node if child exists.
50      *         {@link Optional#absent()} if child does not exists.
51      */
52     Optional<V> getChild(K child);
53 }