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