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.JavaTypeName;
13 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilder;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
17 public final class RuntimeGeneratedTypeBuilder extends AbstractGeneratedTypeBuilder<GeneratedTypeBuilder> implements
18 GeneratedTypeBuilder {
20 public RuntimeGeneratedTypeBuilder(final JavaTypeName identifier) {
26 public GeneratedType build() {
27 return new GeneratedTypeImpl(this);
31 public void setDescription(final String description) {
36 public void setModuleName(final String moduleName) {
41 public void setSchemaPath(final SchemaPath schemaPath) {
46 public void setReference(final String reference) {
51 AbstractEnumerationBuilder newEnumerationBuilder(final JavaTypeName identifier) {
52 return new RuntimeEnumerationBuilder(identifier);
56 public String toString() {
57 final StringBuilder builder = new StringBuilder();
58 builder.append("GeneratedTransferObject [packageName=");
59 builder.append(getPackageName());
60 builder.append(", name=");
61 builder.append(getName());
63 final TypeComment comment = getComment();
64 if (comment != null) {
65 builder.append(", comment=");
66 builder.append(comment.getJavadoc());
68 builder.append(", annotations=");
69 builder.append(getAnnotations());
70 builder.append(", implements=");
71 builder.append(getImplementsTypes());
72 builder.append(", enclosedTypes=");
73 builder.append(getEnclosedTypes());
74 builder.append(", constants=");
75 builder.append(getConstants());
76 builder.append(", enumerations=");
77 builder.append(getEnumerations());
78 builder.append(", properties=");
79 builder.append(", methods=");
80 builder.append(getMethodDefinitions());
82 return builder.toString();
86 protected RuntimeGeneratedTypeBuilder thisInstance() {
90 private static final class GeneratedTypeImpl extends AbstractGeneratedType {
91 GeneratedTypeImpl(final RuntimeGeneratedTypeBuilder builder) {
96 public String getDescription() {
97 throw new UnsupportedOperationException("Not available at runtime");
101 public String getReference() {
102 throw new UnsupportedOperationException("Not available at runtime");
106 public Iterable<QName> getSchemaPath() {
107 throw new UnsupportedOperationException("Not available at runtime");
111 public String getModuleName() {
112 throw new UnsupportedOperationException("Not available at runtime");