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.binding2.generator.util.generated.type.builder;
10 import com.google.common.annotations.Beta;
11 import java.util.List;
12 import java.util.Objects;
13 import org.opendaylight.mdsal.binding2.model.api.AccessModifier;
14 import org.opendaylight.mdsal.binding2.model.api.AnnotationType;
15 import org.opendaylight.mdsal.binding2.model.api.MethodSignature;
16 import org.opendaylight.mdsal.binding2.model.api.Type;
19 class MethodSignatureImpl extends AbstractTypeMember implements MethodSignature {
21 private final List<Parameter> params;
22 private final boolean isAbstract;
24 public MethodSignatureImpl(final Type definingType, final String name,
25 final List<AnnotationType> annotations,
26 final String comment, final AccessModifier accessModifier,
27 final Type returnType, final List<Parameter> params, final boolean isFinal,
28 final boolean isAbstract, final boolean isStatic) {
29 super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
31 this.isAbstract = isAbstract;
35 public boolean isAbstract() {
40 public List<Parameter> getParameters() {
45 public int hashCode() {
46 return Objects.hash(getName(), params, getReturnType());
50 public boolean equals(final Object obj) {
57 if (getClass() != obj.getClass()) {
60 MethodSignatureImpl other = (MethodSignatureImpl) obj;
61 if (!Objects.equals(getName(), other.getName())) {
64 if (!Objects.equals(params, other.params)) {
67 if (!Objects.equals(getReturnType(), other.getReturnType())) {
74 public String toString() {
75 StringBuilder builder = new StringBuilder();
76 builder.append("MethodSignatureImpl [name=");
77 builder.append(getName());
78 builder.append(", comment=");
79 builder.append(getComment());
80 if (getDefiningType() != null) {
81 builder.append(", definingType=");
82 builder.append(getDefiningType().getPackageName());
84 builder.append(getDefiningType().getName());
86 builder.append(", definingType= null");
88 builder.append(", returnType=");
89 builder.append(getReturnType());
90 builder.append(", params=");
91 builder.append(params);
92 builder.append(", annotations=");
93 builder.append(getAnnotations());
95 return builder.toString();