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 java.util.List;
11 import org.opendaylight.mdsal.binding.model.api.AnnotationType;
12 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
13 import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedPropertyBuilder;
15 public final class GeneratedPropertyBuilderImpl extends AbstractTypeMemberBuilder<GeneratedPropertyBuilder>
16 implements GeneratedPropertyBuilder {
18 private boolean readOnly;
20 public GeneratedPropertyBuilderImpl(final String name) {
26 public GeneratedPropertyBuilderImpl setValue(final String value) {
32 public GeneratedPropertyBuilderImpl setReadOnly(final boolean isReadOnly) {
33 this.readOnly = isReadOnly;
38 protected GeneratedPropertyBuilderImpl thisInstance() {
43 public GeneratedProperty toInstance() {
44 final List<AnnotationType> annotations = toAnnotationTypes();
45 return new GeneratedPropertyImpl(getName(), annotations, getComment(), getAccessModifier(), getReturnType(),
46 isFinal(), isStatic(), this.readOnly, this.value);
50 public String toString() {
51 return new StringBuilder()
52 .append("GeneratedPropertyImpl [name=").append(getName())
53 .append(", annotations=").append(getAnnotationBuilders())
54 .append(", comment=").append(getComment())
55 .append(", returnType=").append(getReturnType())
56 .append(", isFinal=").append(isFinal())
57 .append(", isReadOnly=").append(this.readOnly)
58 .append(", modifier=").append(getAccessModifier())
59 .append(']').toString();