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