2 * Copyright (c) 2017 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
9 package org.opendaylight.mdsal.binding.javav2.generator.util.generated.type.builder;
11 import com.google.common.annotations.Beta;
12 import java.util.List;
13 import org.opendaylight.mdsal.binding.javav2.model.api.AccessModifier;
14 import org.opendaylight.mdsal.binding.javav2.model.api.AnnotationType;
15 import org.opendaylight.mdsal.binding.javav2.model.api.GeneratedProperty;
16 import org.opendaylight.mdsal.binding.javav2.model.api.Type;
19 final class GeneratedPropertyImpl extends AbstractTypeMember implements GeneratedProperty {
22 private boolean isReadOnly;
24 GeneratedPropertyImpl(Type definingType, String name, List<AnnotationType> annotations, String comment,
25 AccessModifier accessModifier, Type returnType, boolean isFinal, boolean isStatic,
26 boolean isReadOnly, String value) {
27 super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
29 this.isReadOnly = isReadOnly;
33 public String getValue() {
38 public boolean isReadOnly() {
43 public String toString() {
44 StringBuilder builder = new StringBuilder();
45 builder.append("GeneratedPropertyImpl [name=");
46 builder.append(getName());
47 builder.append(", annotations=");
48 builder.append(getAnnotations());
49 builder.append(", comment=");
50 builder.append(getComment());
51 if (getDefiningType() != null) {
52 builder.append(", parent=");
53 builder.append(getDefiningType().getPackageName());
55 builder.append(getDefiningType().getName());
57 builder.append(", parent=null");
59 builder.append(", returnType=");
60 builder.append(getReturnType());
61 builder.append(", isFinal=");
62 builder.append(isFinal());
63 builder.append(", isReadOnly=");
64 builder.append(isReadOnly);
65 builder.append(", modifier=");
66 builder.append(getAccessModifier());
68 return builder.toString();