eaa3fa6c98d9aaea297d61bc6f1120dee845dc99
[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 javax.annotation.Nonnull;
12 import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
13 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
14
15 /**
16  *
17  * Makes is possible to access to the individual enumeration values of this
18  * type.
19  *
20  */
21 public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
22     /**
23      * Returns all enumeration values.
24      *
25      * @return list of <code>EnumPair</code> type instastances which contain the
26      *         data about all individual enumeration pairs of
27      *         <code>enumeration</code> YANG built-in type
28      */
29     @Nonnull List<EnumPair> getValues();
30
31     /**
32      *
33      * Contains the methods for accessing the data about the concrete
34      * enumeration item which represents <code>enum</code> YANG type.
35      */
36     interface EnumPair extends DocumentedNode {
37         /**
38          * The name to specify each assigned name of an enumeration type.
39          *
40          * @return name of each assigned name of an enumeration type.
41          */
42         String getName();
43
44         /**
45          * The "value" statement, which is optional, is used to associate an
46          * integer value with the assigned name for the enum. This integer value
47          * MUST be in the range -2147483648 to 2147483647, and it MUST be unique
48          * within the enumeration type.
49          *
50          * @return integer value assigned to enumeration
51          */
52         Integer getValue();
53     }
54 }