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