2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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
8 package org.opendaylight.mdsal.binding.model.util.generated.type.builder;
10 import java.util.Optional;
11 import org.opendaylight.mdsal.binding.model.api.Enumeration;
12 import org.opendaylight.mdsal.binding.model.api.Type;
13 import org.opendaylight.mdsal.binding.model.api.TypeComment;
14 import org.opendaylight.mdsal.binding.model.api.YangSourceDefinition;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
18 public final class RuntimeEnumerationBuilder extends AbstractEnumerationBuilder {
19 public RuntimeEnumerationBuilder(final String packageName, final String name) {
20 super(packageName, name);
24 public void setReference(final String reference) {
29 public void setModuleName(final String moduleName) {
34 public void setSchemaPath(final SchemaPath schemaPath) {
39 public void setDescription(final String description) {
44 public Enumeration toInstance(final Type definingType) {
45 return new EnumerationImpl(this, definingType);
49 EnumPair createEnumPair(final String name, final String mappedName, final int value, final String description) {
50 return new EnumPair(name, mappedName, value);
53 private static final class EnumPair extends AbstractPair {
54 EnumPair(final String name, final String mappedName, final int value) {
55 super(name, mappedName, value);
59 public Optional<String> getDescription() {
60 throw new UnsupportedOperationException("Not available at runtime");
64 public Optional<String> getReference() {
65 throw new UnsupportedOperationException("Not available at runtime");
69 private static final class EnumerationImpl extends AbstractEnumeration {
70 EnumerationImpl(final RuntimeEnumerationBuilder builder, final Type definingType) {
71 super(builder, definingType);
75 public TypeComment getComment() {
76 throw new UnsupportedOperationException("Not available at runtime");
80 public String getDescription() {
81 throw new UnsupportedOperationException("Not available at runtime");
85 public String getReference() {
86 throw new UnsupportedOperationException("Not available at runtime");
90 public Iterable<QName> getSchemaPath() {
91 throw new UnsupportedOperationException("Not available at runtime");
95 public String getModuleName() {
96 throw new UnsupportedOperationException("Not available at runtime");
100 public Optional<YangSourceDefinition> getYangSourceDefinition() {
101 throw new UnsupportedOperationException("Not available at runtime");