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