Generate @param for RPC invocation methods
[mdsal.git] / binding / mdsal-binding-generator-util / src / main / java / org / opendaylight / mdsal / binding / model / util / generated / type / builder / GeneratedPropertyImpl.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.binding.model.util.generated.type.builder;
9
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;
16
17 final class GeneratedPropertyImpl extends AbstractTypeMember implements GeneratedProperty {
18     private final String value;
19     private final boolean readOnly;
20
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);
25         this.value = value;
26         this.readOnly = isReadOnly;
27     }
28
29     @Override
30     public String getValue() {
31         return this.value;
32     }
33
34     @Override
35     public boolean isReadOnly() {
36         return this.readOnly;
37     }
38
39     @Override
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())
45             .append(", parent=");
46         if (getDefiningType() != null) {
47             builder.append(getDefiningType().getPackageName()).append(".").append(getDefiningType().getName());
48         } else {
49             builder.append("null");
50         }
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();
56     }
57 }