Fix eclipse/checkstyle warnings
[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  * <p>
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  * <p>
23  * This interface should not be used directly, but rather use of of derived subinterfaces
24  * such as {@link DataContainerNode}, {@link MapNode}, {@link LeafSetNode}.
25  *
26  * @param <I>
27  *            Node Identifier type
28  * @param <K>
29  *            Child Node Identifier type
30  * @param <V>
31  *            Child Node type
32  */
33 public interface NormalizedNodeContainer<I extends PathArgument, K extends PathArgument,
34        V extends NormalizedNode<? extends K, ?>> extends NormalizedNode<I, Collection<V>> {
35
36     @Override
37     I getIdentifier();
38
39     /**
40      * Returns immutable iteration of child nodes of this node.
41      *
42      */
43     @Override
44     Collection<V> getValue();
45
46     /**
47      * Returns child node identified by provided key.
48      *
49      * @param child
50      *            Path argument identifying child node
51      * @return Optional with child node if child exists.
52      *         {@link Optional#absent()} if child does not exists.
53      */
54     Optional<V> getChild(K child);
55 }