Updated code generation
[yangtools.git] / code-generator / binding-model-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / Enumeration.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.yangtools.sal.binding.model.api;\r
9 \r
10 import java.util.List;\r
11 \r
12 /**\r
13  * Interface provide methods for reading data of enumeration class.\r
14  */\r
15 public interface Enumeration extends GeneratedType {\r
16 \r
17     /**\r
18      * \r
19      * Returns list of annotation definitions associated with enumeration type.\r
20      * \r
21      * @return list of annotation definitions associated with enumeration type.\r
22      * \r
23      */\r
24     public List<AnnotationType> getAnnotations();\r
25 \r
26     public Type getParentType();\r
27 \r
28     /**\r
29      * Returns list of the couples - name and value.\r
30      * \r
31      * @return list of the enumeration pairs.\r
32      */\r
33     public List<Pair> getValues();\r
34 \r
35     /**\r
36      * Formats enumeration according to rules of the programming language.\r
37      * \r
38      * @return string with source code in some programming language\r
39      */\r
40     public String toFormattedString();\r
41 \r
42     /**\r
43      * Interface is used for reading enumeration item. It means item's name and\r
44      * its value.\r
45      */\r
46     interface Pair {\r
47 \r
48         /**\r
49          * Returns the name of the enumeration item.\r
50          * \r
51          * @return the name of the enumeration item.\r
52          */\r
53         public String getName();\r
54 \r
55         /**\r
56          * Returns value of the enumeration item.\r
57          * \r
58          * @return the value of the enumeration item.\r
59          */\r
60         public Integer getValue();\r
61     }\r
62 }\r