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.generator.util.generated.type.builder;
10 import java.util.List;
11 import org.opendaylight.mdsal.binding.model.api.AccessModifier;
12 import org.opendaylight.mdsal.binding.model.api.AnnotationType;
13 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
14 import org.opendaylight.mdsal.binding.model.api.Type;
16 final class GeneratedPropertyImpl extends AbstractTypeMember implements GeneratedProperty {
17 private final String value;
18 private final boolean isReadOnly;
20 public GeneratedPropertyImpl(final Type definingType, final String name, final List<AnnotationType> annotations, final String comment,
21 final AccessModifier accessModifier, final Type returnType, final boolean isFinal, final boolean isStatic, final boolean isReadOnly, final String value) {
22 super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
24 this.isReadOnly = isReadOnly;
28 public String getValue() {
33 public boolean isReadOnly() {
34 return this.isReadOnly;
38 public String toString() {
39 final StringBuilder builder = new StringBuilder();
40 builder.append("GeneratedPropertyImpl [name=");
41 builder.append(getName());
42 builder.append(", annotations=");
43 builder.append(getAnnotations());
44 builder.append(", comment=");
45 builder.append(getComment());
46 if (getDefiningType() != null) {
47 builder.append(", parent=");
48 builder.append(getDefiningType().getPackageName());
50 builder.append(getDefiningType().getName());
52 builder.append(", parent=null");
54 builder.append(", returnType=");
55 builder.append(getReturnType());
56 builder.append(", isFinal=");
57 builder.append(isFinal());
58 builder.append(", isReadOnly=");
59 builder.append(this.isReadOnly);
60 builder.append(", modifier=");
61 builder.append(getAccessModifier());
63 return builder.toString();