4ef71ef57f0248650f407327392f9d603b078696
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / type / EnumTypeDefinition.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.yang.model.api.type;
9
10 import java.util.List;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
13 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
14 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
15
16 /**
17  *
18  * Makes is possible to access to the individual enumeration values of this
19  * type.
20  *
21  */
22 public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
23
24     /**
25      * Returns all enumeration values.
26      *
27      * @return list of <code>EnumPair</code> type instastances which contain the
28      *         data about all individual enumeration pairs of
29      *         <code>enumeration</code> YANG built-in type
30      */
31     List<EnumPair> getValues();
32
33     /**
34      *
35      * Contains the methods for accessing the data about the concrete
36      * enumeration item which represents <code>enum</code> YANG type.
37      */
38     interface EnumPair extends SchemaNode {
39
40         /**
41          *
42          * @deprecated Enum pair SHOULD NOT have schema path, since it's argument is only string and
43          *             not QName.
44          *
45          */
46         @Deprecated
47         @Override
48         SchemaPath getPath();
49
50         /**
51          *
52          * @deprecated Enum pair SHOULD NOT have QName, since it's argument is only string (allows
53          *             characters not allowed in QName) and not QName. Use {@link #getName()}
54          *             instead.
55          *
56          */
57         @Deprecated
58         @Override
59         QName getQName();
60
61         /**
62          * The name to specify each assigned name of an enumeration type.
63          *
64          * @return name of each assigned name of an enumeration type.
65          */
66         String getName();
67
68         /**
69          * The "value" statement, which is optional, is used to associate an
70          * integer value with the assigned name for the enum. This integer value
71          * MUST be in the range -2147483648 to 2147483647, and it MUST be unique
72          * within the enumeration type.
73          *
74          * @return integer value assigned to enumeration
75          */
76         Integer getValue();
77     }
78 }