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 org.opendaylight.mdsal.binding.model.api.GeneratedType;
11 import org.opendaylight.mdsal.binding.model.api.TypeComment;
12 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilder;
13 import org.opendaylight.yangtools.yang.common.QName;
15 public final class RuntimeGeneratedTypeBuilder extends AbstractGeneratedTypeBuilder<GeneratedTypeBuilder> implements
16 GeneratedTypeBuilder {
18 public RuntimeGeneratedTypeBuilder(final String packageName, final String name) {
19 super(packageName, name);
24 public GeneratedType toInstance() {
25 return new GeneratedTypeImpl(this);
29 public void setDescription(final String description) {
34 public void setModuleName(final String moduleName) {
39 public void setSchemaPath(final Iterable<QName> schemaPath) {
44 public void setReference(final String reference) {
49 AbstractEnumerationBuilder newEnumerationBuilder(final String packageName, final String name) {
50 return new RuntimeEnumerationBuilder(packageName, name);
54 public String toString() {
55 final StringBuilder builder = new StringBuilder();
56 builder.append("GeneratedTransferObject [packageName=");
57 builder.append(getPackageName());
58 builder.append(", name=");
59 builder.append(getName());
61 final TypeComment comment = getComment();
62 if (comment != null) {
63 builder.append(", comment=");
64 builder.append(comment.getJavadoc());
66 builder.append(", annotations=");
67 builder.append(getAnnotations());
68 builder.append(", implements=");
69 builder.append(getImplementsTypes());
70 builder.append(", enclosedTypes=");
71 builder.append(getEnclosedTypes());
72 builder.append(", constants=");
73 builder.append(getConstants());
74 builder.append(", enumerations=");
75 builder.append(getEnumerations());
76 builder.append(", properties=");
77 builder.append(", methods=");
78 builder.append(getMethodDefinitions());
80 return builder.toString();
84 protected RuntimeGeneratedTypeBuilder thisInstance() {
88 private static final class GeneratedTypeImpl extends AbstractGeneratedType {
89 GeneratedTypeImpl(final RuntimeGeneratedTypeBuilder builder) {
94 public String getDescription() {
95 throw new UnsupportedOperationException("Not available at runtime");
99 public String getReference() {
100 throw new UnsupportedOperationException("Not available at runtime");
104 public Iterable<QName> getSchemaPath() {
105 throw new UnsupportedOperationException("Not available at runtime");
109 public String getModuleName() {
110 throw new UnsupportedOperationException("Not available at runtime");