BUG-865: deprecated DataNodeContainer.getDataChildByName(String)
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / DataNodeContainer.java
1 /*
2  * Copyright (c) 2013 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.model.api;
9
10 import java.util.Collection;
11 import java.util.Set;
12 import org.opendaylight.yangtools.yang.common.QName;
13
14 /**
15  * Node which can contains other nodes.
16  */
17 public interface DataNodeContainer {
18
19     /**
20      * Returns set of all newly defined types within this DataNodeContainer.
21      *
22      * @return typedef statements in lexicographical order
23      */
24     Set<TypeDefinition<?>> getTypeDefinitions();
25
26     /**
27      * Returns set of all child nodes defined within this DataNodeContainer.
28      * Although the return type is a collection, each node is guaranteed to
29      * be present at most once.
30      *
31      * @return child nodes in lexicographical order
32      */
33     Collection<DataSchemaNode> getChildNodes();
34
35     /**
36      * Returns set of all groupings defined within this DataNodeContainer.
37      *
38      * @return grouping statements in lexicographical order
39      */
40     Set<GroupingDefinition> getGroupings();
41
42     /**
43      * @param name
44      *            QName of seeked child
45      * @return child node of this DataNodeContainer if child with given name is
46      *         present, null otherwise
47      */
48     DataSchemaNode getDataChildByName(QName name);
49
50     /**
51      * @param name
52      *            name of seeked child as String
53      * @return child node of this DataNodeContainer if child with given name is
54      *         present, null otherwise
55      *
56      * @deprecated This method disregards the namespace and thus leads to unpredictable results
57      *             when multiple children exist with the same localname, but with different namespaces.
58      */
59     @Deprecated
60     DataSchemaNode getDataChildByName(String name);
61
62     /**
63      * @return Set of all uses nodes defined within this DataNodeContainer
64      */
65     Set<UsesNode> getUses();
66
67 }