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;
15 import org.opendaylight.mdsal.binding.model.api.TypeMemberComment;
17 final class GeneratedPropertyImpl extends AbstractTypeMember implements GeneratedProperty {
18 private final String value;
19 private final boolean readOnly;
21 GeneratedPropertyImpl(final Type definingType, final String name, final List<AnnotationType> annotations,
22 final TypeMemberComment comment, final AccessModifier accessModifier, final Type returnType,
23 final boolean isFinal, final boolean isStatic, final boolean isReadOnly, final String value) {
24 super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
26 this.readOnly = isReadOnly;
30 public String getValue() {
35 public boolean isReadOnly() {
40 public String toString() {
41 final StringBuilder builder = new StringBuilder()
42 .append("GeneratedPropertyImpl [name=").append(getName())
43 .append(", annotations=").append(getAnnotations())
44 .append(", comment=").append(getComment())
46 if (getDefiningType() != null) {
47 builder.append(getDefiningType().getPackageName()).append(".").append(getDefiningType().getName());
49 builder.append("null");
51 return builder.append(", returnType=").append(getReturnType())
52 .append(", isFinal=").append(isFinal())
53 .append(", isReadOnly=").append(readOnly)
54 .append(", modifier=").append(getAccessModifier())
55 .append(']').toString();