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.yangtools.binding.generator.util.generated.type.builder;
10 import java.util.List;
12 import org.opendaylight.yangtools.sal.binding.model.api.AccessModifier;
13 import org.opendaylight.yangtools.sal.binding.model.api.AnnotationType;
14 import org.opendaylight.yangtools.sal.binding.model.api.GeneratedProperty;
15 import org.opendaylight.yangtools.sal.binding.model.api.Type;
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 isStatic, boolean isReadOnly, String value) {
23 super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
25 this.isReadOnly = isReadOnly;
29 public String getValue() {
34 public boolean isReadOnly() {
39 public String toString() {
40 StringBuilder builder = new StringBuilder();
41 builder.append("GeneratedPropertyImpl [name=");
42 builder.append(getName());
43 builder.append(", annotations=");
44 builder.append(getAnnotations());
45 builder.append(", comment=");
46 builder.append(getComment());
47 if (getDefiningType() != null) {
48 builder.append(", parent=");
49 builder.append(getDefiningType().getPackageName());
51 builder.append(getDefiningType().getName());
53 builder.append(", parent=null");
55 builder.append(", returnType=");
56 builder.append(getReturnType());
57 builder.append(", isFinal=");
58 builder.append(isFinal());
59 builder.append(", isReadOnly=");
60 builder.append(isReadOnly);
61 builder.append(", modifier=");
62 builder.append(getAccessModifier());
64 return builder.toString();