7d5054a2276d77623868ea2d5e0c92167db9a2c3
[yangtools.git] / code-generator / binding-model-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 /**
13  * Interface provide methods for reading data of enumeration class.
14  */
15 public interface Enumeration extends Type {
16
17     /**
18      * 
19      * Returns list of annotation definitions associated with enumeration type.
20      * 
21      * @return list of annotation definitions associated with enumeration type.
22      * 
23      */
24     public List<AnnotationType> getAnnotations();
25
26     public Type getDefiningType();
27
28     /**
29      * Returns list of the couples - name and value.
30      * 
31      * @return list of the enumeration pairs.
32      */
33     public List<Pair> getValues();
34
35     /**
36      * Formats enumeration according to rules of the programming language.
37      * 
38      * @return string with source code in some programming language
39      */
40     public String toFormattedString();
41
42     /**
43      * Interface is used for reading enumeration item. It means item's name and
44      * its value.
45      */
46     interface Pair {
47
48         /**
49          * Returns the name of the enumeration item.
50          * 
51          * @return the name of the enumeration item.
52          */
53         public String getName();
54
55         /**
56          * Returns value of the enumeration item.
57          * 
58          * @return the value of the enumeration item.
59          */
60         public Integer getValue();
61     }
62 }