9ca7f436512aad34aa151b49186b342e1212969b
[mdsal.git] / binding / mdsal-binding-generator-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / Enumeration.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.sal.binding.model.api;
9
10 import java.util.List;
11
12 import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
13
14 /**
15  * Interface provide methods for reading data of enumeration class.
16  */
17 public interface Enumeration extends GeneratedType {
18
19     /**
20      *
21      * Returns list of annotation definitions associated with enumeration type.
22      *
23      * @return list of annotation definitions associated with enumeration type.
24      *
25      */
26     @Override
27     List<AnnotationType> getAnnotations();
28
29     @Override
30     Type getParentType();
31
32     /**
33      * Returns list of the couples - name and value.
34      *
35      * @return list of the enumeration pairs.
36      */
37     List<Pair> getValues();
38
39     /**
40      * Formats enumeration according to rules of the programming language.
41      *
42      * @return string with source code in some programming language
43      */
44     String toFormattedString();
45
46     /**
47      * Interface is used for reading enumeration item. It means item's name and
48      * its value.
49      */
50     interface Pair extends DocumentedNode {
51
52         /**
53          * Returns the name of the enumeration item as it is specified in the input yang.
54          *
55          * @return the name of the enumeration item as it is specified in the input yang.
56          */
57         String getName();
58
59         /**
60          * Returns the binding representation for the name of the enumeration item.
61          *
62          * @return the binding representation for the name of the enumeration item.
63          */
64         String getMappedName();
65
66         /**
67          * Returns value of the enumeration item.
68          *
69          * @return the value of the enumeration item.
70          */
71         Integer getValue();
72     }
73 }