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 org.opendaylight.mdsal.binding2.model.api.Enumeration;
13 import org.opendaylight.mdsal.binding2.model.api.Type;
14 import org.opendaylight.yangtools.yang.model.api.Status;
15 import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
18 * Enum Builder is interface that contains methods to build and instantiate
19 * Enumeration definition.
24 public interface EnumBuilder extends Type {
26 * The method creates new AnnotationTypeBuilder containing specified package
27 * name and annotation name. <br>
28 * Neither the package name or annotation name can contain <code>null</code>
29 * references. In case that any of parameters contains <code>null</code> the
30 * method SHOULD throw {@link IllegalArgumentException}
33 * Package Name of Annotation Type
35 * Name of Annotation Type
36 * @return <code>new</code> instance of Annotation Type Builder.
38 AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
45 * as optionally defined in YANG model
47 * as optionally defined in YANG model
49 * as optionally defined in YANG model
51 * as optionally defined in YANG model
53 void addValue(final String name, final int value, final String description,
54 final String reference, final Status status);
62 Enumeration toInstance(final Type definingType);
65 * Updates this builder with data from <code>enumTypeDef</code>.
66 * Specifically this data represents list of value-name pairs.
69 * enum type definition as source of enum data for
70 * <code>enumBuilder</code>
72 void updateEnumPairsFromEnumTypeDef(final EnumTypeDefinition enumTypeDef);
77 void setDescription(final String description);