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.JavaTypeName;
13 import org.opendaylight.mdsal.binding.model.api.Restrictions;
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 class CodegenGeneratedTOBuilder extends AbstractGeneratedTOBuilder {
19 private Restrictions restrictions;
20 private GeneratedPropertyBuilder suid;
21 private String reference;
22 private String description;
23 private String moduleName;
24 private SchemaPath schemaPath;
26 public CodegenGeneratedTOBuilder(final JavaTypeName identifier) {
31 public final void setRestrictions(final Restrictions restrictions) {
32 this.restrictions = restrictions;
36 public final void setSUID(final GeneratedPropertyBuilder newSuid) {
41 public final void setDescription(final String description) {
42 this.description = description;
46 public final void setModuleName(final String moduleName) {
47 this.moduleName = moduleName;
51 public final void setSchemaPath(final SchemaPath schemaPath) {
52 this.schemaPath = schemaPath;
56 public final void setReference(final String reference) {
57 this.reference = reference;
61 public final GeneratedTransferObject build() {
65 private static final class GTO extends AbstractGeneratedTransferObject {
66 private final Restrictions restrictions;
67 private final GeneratedProperty suid;
68 private final String reference;
69 private final String description;
70 private final String moduleName;
71 private final SchemaPath schemaPath;
73 GTO(final CodegenGeneratedTOBuilder builder) {
75 this.restrictions = builder.restrictions;
76 this.reference = builder.reference;
77 this.description = builder.description;
78 this.moduleName = builder.moduleName;
79 this.schemaPath = builder.schemaPath;
81 if (builder.suid == null) {
84 this.suid = builder.suid.toInstance();
89 public Restrictions getRestrictions() {
90 return this.restrictions;
94 public GeneratedProperty getSUID() {
99 public String getDescription() {
100 return this.description;
104 public String getReference() {
105 return this.reference;
109 public Iterable<QName> getSchemaPath() {
110 return this.schemaPath.getPathFromRoot();
114 public String getModuleName() {
115 return this.moduleName;