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.JavaTypeName;
12 import org.opendaylight.mdsal.binding.model.api.TypeComment;
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 public String toString() {
52 final StringBuilder builder = new StringBuilder();
53 builder.append("GeneratedTransferObject [packageName=");
54 builder.append(getPackageName());
55 builder.append(", name=");
56 builder.append(getName());
58 final TypeComment comment = getComment();
59 if (comment != null) {
60 builder.append(", comment=");
61 builder.append(comment.getJavadoc());
63 builder.append(", annotations=");
64 builder.append(getAnnotations());
65 builder.append(", implements=");
66 builder.append(getImplementsTypes());
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() {
94 public String getReference() {
99 public Iterable<QName> getSchemaPath() {
104 public String getModuleName() {
108 private static UnsupportedOperationException unsupported() {
109 return new UnsupportedOperationException("Not available at runtime");