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.controller.binding.generator.util.generated.type.builder;
10 import org.opendaylight.controller.sal.binding.model.api.AccessModifier;
11 import org.opendaylight.controller.sal.binding.model.api.AnnotationType;
12 import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
13 import org.opendaylight.controller.sal.binding.model.api.Type;
15 import java.util.List;
17 final class GeneratedPropertyImpl extends AbstractTypeMember implements GeneratedProperty {
19 private boolean isReadOnly;
21 public GeneratedPropertyImpl(Type definingType, String name, List<AnnotationType> annotations, String comment,
22 AccessModifier accessModifier, Type returnType, boolean isFinal, boolean isReadOnly) {
23 super(definingType, name, annotations, comment, accessModifier, returnType, isFinal);
24 this.isReadOnly = isReadOnly;
28 public boolean isReadOnly() {
33 public String toString() {
34 StringBuilder builder = new StringBuilder();
35 builder.append("GeneratedPropertyImpl [name=");
36 builder.append(getName());
37 builder.append(", annotations=");
38 builder.append(getAnnotations());
39 builder.append(", comment=");
40 builder.append(getComment());
41 if (getDefiningType() != null) {
42 builder.append(", parent=");
43 builder.append(getDefiningType().getPackageName());
45 builder.append(getDefiningType().getName());
47 builder.append(", parent=null");
49 builder.append(", returnType=");
50 builder.append(getReturnType());
51 builder.append(", isFinal=");
52 builder.append(isFinal());
53 builder.append(", isReadOnly=");
54 builder.append(isReadOnly);
55 builder.append(", modifier=");
56 builder.append(getAccessModifier());
58 return builder.toString();