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.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 readOnly;
20 GeneratedPropertyImpl(final Type definingType, final String name, final List<AnnotationType> annotations,
21 final String comment, final AccessModifier accessModifier, final Type returnType, final boolean isFinal,
22 final boolean isStatic, final boolean isReadOnly, final String value) {
23 super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
25 this.readOnly = isReadOnly;
29 public String getValue() {
34 public boolean isReadOnly() {
39 public String toString() {
40 final 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(this.readOnly);
61 builder.append(", modifier=");
62 builder.append(getAccessModifier());
64 return builder.toString();