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 public String toString() {
50 final StringBuilder builder = new StringBuilder();
51 builder.append("GeneratedTransferObject [packageName=");
52 builder.append(getPackageName());
53 builder.append(", name=");
54 builder.append(getName());
56 final TypeComment comment = getComment();
57 if (comment != null) {
58 builder.append(", comment=");
59 builder.append(comment.getJavadoc());
61 builder.append(", annotations=");
62 builder.append(getAnnotations());
63 builder.append(", implements=");
64 builder.append(getImplementsTypes());
65 builder.append(", enclosedTypes=");
66 builder.append(getEnclosedTypes());
67 builder.append(", constants=");
68 builder.append(getConstants());
69 builder.append(", enumerations=");
70 builder.append(getEnumerations());
71 builder.append(", properties=");
72 builder.append(", methods=");
73 builder.append(getMethodDefinitions());
75 return builder.toString();
79 protected RuntimeGeneratedTypeBuilder thisInstance() {
83 private static final class GeneratedTypeImpl extends AbstractGeneratedType {
84 GeneratedTypeImpl(final RuntimeGeneratedTypeBuilder builder) {
89 public String getDescription() {
90 throw new UnsupportedOperationException("Not available at runtime");
94 public String getReference() {
95 throw new UnsupportedOperationException("Not available at runtime");
99 public Iterable<QName> getSchemaPath() {
100 throw new UnsupportedOperationException("Not available at runtime");
104 public String getModuleName() {
105 throw new UnsupportedOperationException("Not available at runtime");