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;
19 private final boolean nullifyEmpty;
21 GeneratedPropertyImpl(final Type definingType, final String name, final List<AnnotationType> annotations,
22 final String comment, final AccessModifier accessModifier, final Type returnType, final boolean isFinal,
23 final boolean isStatic, final boolean isReadOnly, final boolean nullifyEmpty, final String value) {
24 super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
26 this.readOnly = isReadOnly;
27 this.nullifyEmpty = nullifyEmpty;
31 public String getValue() {
36 public boolean isReadOnly() {
41 public boolean nullifyEmpty() {
42 return this.nullifyEmpty;
46 public String toString() {
47 final StringBuilder builder = new StringBuilder();
48 builder.append("GeneratedPropertyImpl [name=");
49 builder.append(getName());
50 builder.append(", annotations=");
51 builder.append(getAnnotations());
52 builder.append(", comment=");
53 builder.append(getComment());
54 if (getDefiningType() != null) {
55 builder.append(", parent=");
56 builder.append(getDefiningType().getPackageName());
58 builder.append(getDefiningType().getName());
60 builder.append(", parent=null");
62 builder.append(", returnType=");
63 builder.append(getReturnType());
64 builder.append(", isFinal=");
65 builder.append(isFinal());
66 builder.append(", isReadOnly=");
67 builder.append(this.readOnly);
68 builder.append(", modifier=");
69 builder.append(getAccessModifier());
71 return builder.toString();