BUG-6316: Fix Bit and EnumPair's position/value types
[mdsal.git] / binding / mdsal-binding-generator-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / type / builder / EnumBuilder.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.type.builder;
9
10 import org.opendaylight.yangtools.sal.binding.model.api.Enumeration;
11 import org.opendaylight.yangtools.sal.binding.model.api.Type;
12 import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
13
14 /**
15  * Enum Builder is interface that contains methods to build and instantiate
16  * Enumeration definition.
17  *
18  * @see Enumeration
19  */
20 public interface EnumBuilder extends Type {
21
22     /**
23      * The method creates new AnnotationTypeBuilder containing specified package
24      * name an annotation name. <br>
25      * Neither the package name or annotation name can contain <code>null</code>
26      * references. In case that any of parameters contains <code>null</code> the
27      * method SHOULD thrown {@link IllegalArgumentException}
28      *
29      * @param packageName
30      *            Package Name of Annotation Type
31      * @param name
32      *            Name of Annotation Type
33      * @return <code>new</code> instance of Annotation Type Builder.
34      */
35     AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
36
37     /**
38      *
39      * @param name
40      * @param value
41      */
42     void addValue(final String name, final int value, final String description);
43
44     /**
45      *
46      * @param definingType
47      * @return
48      */
49     Enumeration toInstance(final Type definingType);
50
51     /**
52      * Updates this builder with data from <code>enumTypeDef</code>.
53      * Specifically this data represents list of value-name pairs.
54      *
55      * @param enumTypeDef
56      *            enum type definition as source of enum data for
57      *            <code>enumBuilder</code>
58      */
59     void updateEnumPairsFromEnumTypeDef(final EnumTypeDefinition enumTypeDef);
60
61     /**
62      * @param description
63      */
64     void setDescription(final String description);
65
66 }