d06e51e7b8491622dbd0d860402a5988e089a1b8
[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  * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.Enumeration} instead.
18  */
19 @Deprecated
20 public interface Enumeration extends GeneratedType {
21
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 as it is specified in the input yang.
57          *
58          * @return the name of the enumeration item as it is specified in the input yang.
59          */
60         String getName();
61
62         /**
63          * Returns the binding representation for the name of the enumeration item.
64          *
65          * @return the binding representation for the name of the enumeration item.
66          */
67         String getMappedName();
68
69         /**
70          * Returns value of the enumeration item.
71          *
72          * @return the value of the enumeration item.
73          */
74         int getValue();
75     }
76 }