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.type.builder.GeneratedPropertyBuilder;
14 import org.opendaylight.yangtools.yang.common.QName;
16 public final class CodegenGeneratedTOBuilder extends AbstractGeneratedTOBuilder {
18 private Restrictions restrictions;
19 private GeneratedPropertyBuilder SUID;
20 private String reference;
21 private String description;
22 private String moduleName;
23 private Iterable<QName> schemaPath;
25 public CodegenGeneratedTOBuilder(final String packageName, final String name) {
26 super(packageName, name);
30 public void setRestrictions(final Restrictions restrictions) {
31 this.restrictions = restrictions;
35 public void setSUID(final GeneratedPropertyBuilder suid) {
40 public GeneratedTransferObject toInstance() {
45 public void setDescription(final String description) {
46 this.description = description;
50 public void setModuleName(final String moduleName) {
51 this.moduleName = moduleName;
55 public void setSchemaPath(final Iterable<QName> schemaPath) {
56 this.schemaPath = schemaPath;
60 public void setReference(final String reference) {
61 this.reference = reference;
64 private static final class GTO extends AbstractGeneratedTransferObject {
65 private final Restrictions restrictions;
66 private final GeneratedProperty SUID;
67 private final String reference;
68 private final String description;
69 private final String moduleName;
70 private final Iterable<QName> schemaPath;
72 public GTO(final CodegenGeneratedTOBuilder builder) {
74 this.restrictions = builder.restrictions;
75 this.reference = builder.reference;
76 this.description = builder.description;
77 this.moduleName = builder.moduleName;
78 this.schemaPath = builder.schemaPath;
80 if (builder.SUID == null) {
83 this.SUID = builder.SUID.toInstance(GTO.this);
88 public Restrictions getRestrictions() {
89 return this.restrictions;
93 public GeneratedProperty getSUID() {
98 public String getDescription() {
99 return this.description;
103 public String getReference() {
104 return this.reference;
108 public Iterable<QName> getSchemaPath() {
109 return this.schemaPath;
113 public String getModuleName() {
114 return this.moduleName;