Fix license header violations in yang-data-api
[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  *
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 com.google.common.base.Optional;
11 import java.util.Collection;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
13
14 /**
15  * Node which is not leaf, but has child {@link NormalizedNode}s as its valzue.
16  *
17  *
18  * NormalizedNodeContainer does not have a value, but it has a child
19  * nodes. Definition of possible and valid child nodes is introduced
20  * in subclasses of this interface.
21  *
22  * This interface should not be used directly, but rather use of of derived subinterfaces
23  * such as {@link DataContainerNode}, {@link MapNode}, {@link LeafSetNode}.
24  *
25  * @param <I>
26  *            Node Identifier type
27  * @param <K>
28  *            Child Node Identifier type
29  * @param <V>
30  *            Child Node type
31  */
32 public interface NormalizedNodeContainer<I extends PathArgument, K extends PathArgument, V extends NormalizedNode<? extends K, ?>>
33         extends NormalizedNode<I, Collection<V>> {
34
35     @Override
36     I getIdentifier();
37
38     /**
39      * Returns immutable iteration of child nodes of this node.
40      *
41      */
42     @Override
43     Collection<V> getValue();
44
45     /**
46      * Returns child node identified by provided key.
47      *
48      * @param child
49      *            Path argument identifying child node
50      * @return Optional with child node if child exists.
51      *         {@link Optional#absent()} if child does not exists.
52      */
53     Optional<V> getChild(K child);
54 }