2 * Copyright (c) 2013 Cisco Systems, Inc. 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.GeneratedProperty;
11 import org.opendaylight.mdsal.binding.model.api.GeneratedTransferObject;
12 import org.opendaylight.mdsal.binding.model.api.Restrictions;
13 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
14 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedPropertyBuilder;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
18 public final class CodegenGeneratedTOBuilder extends AbstractGeneratedTOBuilder {
20 private Restrictions restrictions;
21 private GeneratedPropertyBuilder SUID;
22 private String reference;
23 private String description;
24 private String moduleName;
25 private SchemaPath schemaPath;
27 public CodegenGeneratedTOBuilder(final JavaTypeName identifier) {
32 public void setRestrictions(final Restrictions restrictions) {
33 this.restrictions = restrictions;
37 public void setSUID(final GeneratedPropertyBuilder suid) {
42 public GeneratedTransferObject build() {
47 public void setDescription(final String description) {
48 this.description = description;
52 public void setModuleName(final String moduleName) {
53 this.moduleName = moduleName;
57 public void setSchemaPath(final SchemaPath schemaPath) {
58 this.schemaPath = schemaPath;
62 public void setReference(final String reference) {
63 this.reference = reference;
67 AbstractEnumerationBuilder newEnumerationBuilder(final JavaTypeName identifier) {
68 return new CodegenEnumerationBuilder(identifier);
71 private static final class GTO extends AbstractGeneratedTransferObject {
72 private final Restrictions restrictions;
73 private final GeneratedProperty SUID;
74 private final String reference;
75 private final String description;
76 private final String moduleName;
77 private final SchemaPath schemaPath;
79 public GTO(final CodegenGeneratedTOBuilder builder) {
81 this.restrictions = builder.restrictions;
82 this.reference = builder.reference;
83 this.description = builder.description;
84 this.moduleName = builder.moduleName;
85 this.schemaPath = builder.schemaPath;
87 if (builder.SUID == null) {
90 this.SUID = builder.SUID.toInstance(GTO.this);
95 public Restrictions getRestrictions() {
96 return this.restrictions;
100 public GeneratedProperty getSUID() {
105 public String getDescription() {
106 return this.description;
110 public String getReference() {
111 return this.reference;
115 public Iterable<QName> getSchemaPath() {
116 return this.schemaPath.getPathFromRoot();
120 public String getModuleName() {
121 return this.moduleName;