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