Bug 2512: Initial design of YANG statement meta-model.
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / ChoiceNode.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.Set;
11
12 import org.opendaylight.yangtools.yang.common.QName;
13
14 /**
15  *
16  * The ChoiceNode defines a set of alternatives. It consists of a number of
17  * branches defined as ChoiceCaseNode objects.
18  */
19 public interface ChoiceNode extends DataSchemaNode, AugmentationTarget {
20
21     /**
22      * Returns cases of choice.
23      *
24      * @return set of ChoiceCaseNode objects defined in this node which
25      *         represents set of arguments of the YANG <code>case</code>
26      *         substatement of the <code>choice</code> statement
27      */
28     Set<ChoiceCaseNode> getCases();
29
30     /**
31      *
32      * Returns the concrete case according to specified Q name.
33      *
34      * @param name
35      *            QName of seeked Choice Case Node
36      * @return child case node of this Choice if child with given name is
37      *         present, <code>null</code> otherwise
38      */
39     ChoiceCaseNode getCaseNodeByName(QName name);
40
41     /**
42      * Returns the concrete case according to specified name.
43      *
44      * @param name
45      *            name of seeked child as String
46      * @return child case node (or local name of case node) of this Choice if
47      *         child with given name is present, <code>null</code> otherwise
48      */
49     ChoiceCaseNode getCaseNodeByName(String name);
50
51     /**
52      *
53      * Returns name of case which is in the choice specified as default
54      *
55      * @return string with the name of case which is specified in the argument
56      *         of the YANG <code>default</code> substatement of
57      *         <code>choice</code> statement.
58      */
59     String getDefaultCase();
60
61 }