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;
14 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16 public final class RuntimeGeneratedTypeBuilder extends AbstractGeneratedTypeBuilder<GeneratedTypeBuilder> implements
17 GeneratedTypeBuilder {
19 public RuntimeGeneratedTypeBuilder(final String packageName, final String name) {
20 super(packageName, name);
25 public GeneratedType toInstance() {
26 return new GeneratedTypeImpl(this);
30 public void setDescription(final String description) {
35 public void setModuleName(final String moduleName) {
40 public void setSchemaPath(final SchemaPath schemaPath) {
45 public void setReference(final String reference) {
50 AbstractEnumerationBuilder newEnumerationBuilder(final String packageName, final String name) {
51 return new RuntimeEnumerationBuilder(packageName, name);
55 public String toString() {
56 final StringBuilder builder = new StringBuilder();
57 builder.append("GeneratedTransferObject [packageName=");
58 builder.append(getPackageName());
59 builder.append(", name=");
60 builder.append(getName());
62 final TypeComment comment = getComment();
63 if (comment != null) {
64 builder.append(", comment=");
65 builder.append(comment.getJavadoc());
67 builder.append(", annotations=");
68 builder.append(getAnnotations());
69 builder.append(", implements=");
70 builder.append(getImplementsTypes());
71 builder.append(", enclosedTypes=");
72 builder.append(getEnclosedTypes());
73 builder.append(", constants=");
74 builder.append(getConstants());
75 builder.append(", enumerations=");
76 builder.append(getEnumerations());
77 builder.append(", properties=");
78 builder.append(", methods=");
79 builder.append(getMethodDefinitions());
81 return builder.toString();
85 protected RuntimeGeneratedTypeBuilder thisInstance() {
89 private static final class GeneratedTypeImpl extends AbstractGeneratedType {
90 GeneratedTypeImpl(final RuntimeGeneratedTypeBuilder builder) {
95 public String getDescription() {
96 throw new UnsupportedOperationException("Not available at runtime");
100 public String getReference() {
101 throw new UnsupportedOperationException("Not available at runtime");
105 public Iterable<QName> getSchemaPath() {
106 throw new UnsupportedOperationException("Not available at runtime");
110 public String getModuleName() {
111 throw new UnsupportedOperationException("Not available at runtime");