2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.mdsal.binding2.model.api.type.builder;
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;
17 * Enum Builder is interface that contains methods to build and instantiate
18 * Enumeration definition.
23 public interface EnumBuilder extends Type {
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}
32 * Package Name of Annotation Type
34 * Name of Annotation Type
35 * @return <code>new</code> instance of Annotation Type Builder.
37 AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
44 void addValue(final String name, final Integer value, final String description);
51 Enumeration toInstance(final Type definingType);
54 * Updates this builder with data from <code>enumTypeDef</code>.
55 * Specifically this data represents list of value-name pairs.
58 * enum type definition as source of enum data for
59 * <code>enumBuilder</code>
61 void updateEnumPairsFromEnumTypeDef(final EnumTypeDefinition enumTypeDef);
66 void setDescription(final String description);