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.JavaTypeName;
15 import org.opendaylight.mdsal.binding.model.api.YangSourceDefinition;
16 import org.opendaylight.yangtools.yang.common.QName;
17 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
18 import org.opendaylight.yangtools.yang.model.api.Status;
20 public final class RuntimeEnumerationBuilder extends AbstractEnumerationBuilder {
21 public RuntimeEnumerationBuilder(final JavaTypeName identifier) {
26 public void setReference(final String reference) {
31 public void setModuleName(final String moduleName) {
36 public void setSchemaPath(final SchemaPath schemaPath) {
41 public void setDescription(final String description) {
46 public Enumeration toInstance(final Type definingType) {
47 return new EnumerationImpl(this, definingType);
51 EnumPair createEnumPair(final String name, final String mappedName, final int value, final Status status,
52 final String description, final String reference) {
53 return new EnumPair(name, mappedName, value);
56 private static final class EnumPair extends AbstractPair {
57 EnumPair(final String name, final String mappedName, final int value) {
58 super(name, mappedName, value);
62 public Optional<String> getDescription() {
63 throw new UnsupportedOperationException("Not available at runtime");
67 public Optional<String> getReference() {
68 throw new UnsupportedOperationException("Not available at runtime");
72 public Status getStatus() {
73 throw new UnsupportedOperationException("Not available at runtime");
77 private static final class EnumerationImpl extends AbstractEnumeration {
78 EnumerationImpl(final RuntimeEnumerationBuilder builder, final Type definingType) {
79 super(builder, definingType);
83 public TypeComment getComment() {
84 throw new UnsupportedOperationException("Not available at runtime");
88 public String getDescription() {
89 throw new UnsupportedOperationException("Not available at runtime");
93 public String getReference() {
94 throw new UnsupportedOperationException("Not available at runtime");
98 public Iterable<QName> getSchemaPath() {
99 throw new UnsupportedOperationException("Not available at runtime");
103 public String getModuleName() {
104 throw new UnsupportedOperationException("Not available at runtime");
108 public Optional<YangSourceDefinition> getYangSourceDefinition() {
109 throw new UnsupportedOperationException("Not available at runtime");