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