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.GeneratedType;
11 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
12 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilder;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16 public final class CodegenGeneratedTypeBuilder extends AbstractGeneratedTypeBuilder<GeneratedTypeBuilder> implements
17 GeneratedTypeBuilder {
19 private String description;
20 private String reference;
21 private String moduleName;
22 private SchemaPath schemaPath;
24 public CodegenGeneratedTypeBuilder(final JavaTypeName identifier) {
30 public void setDescription(final String description) {
31 this.description = description;
35 public void setModuleName(final String moduleName) {
36 this.moduleName = moduleName;
40 public void setSchemaPath(final SchemaPath schemaPath) {
41 this.schemaPath = schemaPath;
45 public void setReference(final String reference) {
46 this.reference = reference;
50 public GeneratedType build() {
51 return new GeneratedTypeImpl(this);
55 protected CodegenGeneratedTypeBuilder thisInstance() {
59 private static final class GeneratedTypeImpl extends AbstractGeneratedType {
61 private final String description;
62 private final String reference;
63 private final String moduleName;
64 private final SchemaPath schemaPath;
66 GeneratedTypeImpl(final CodegenGeneratedTypeBuilder builder) {
69 this.description = builder.description;
70 this.reference = builder.reference;
71 this.moduleName = builder.moduleName;
72 this.schemaPath = builder.schemaPath;
76 public String getDescription() {
77 return this.description;
81 public String getReference() {
82 return this.reference;
86 public Iterable<QName> getSchemaPath() {
87 return this.schemaPath.getPathFromRoot();
91 public String getModuleName() {
92 return this.moduleName;