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.yangtools.binding.generator.util.generated.type.builder;
10 import java.util.List;
11 import java.util.Objects;
12 import org.opendaylight.yangtools.sal.binding.model.api.AccessModifier;
13 import org.opendaylight.yangtools.sal.binding.model.api.AnnotationType;
14 import org.opendaylight.yangtools.sal.binding.model.api.MethodSignature;
15 import org.opendaylight.yangtools.sal.binding.model.api.Type;
18 * @deprecated Use {@link org.opendaylight.mdsal.binding.generator.util.generated.type.builder.MethodSignatureImpl} instead.
21 class MethodSignatureImpl extends AbstractTypeMember implements MethodSignature {
23 private final List<Parameter> params;
24 private final boolean isAbstract;
26 public MethodSignatureImpl(final Type definingType, final String name,
27 final List<AnnotationType> annotations,
28 final String comment, final AccessModifier accessModifier,
29 final Type returnType, final List<Parameter> params, final boolean isFinal,
30 final boolean isAbstract, final boolean isStatic) {
31 super(definingType, name, annotations, comment, accessModifier, returnType, isFinal, isStatic);
33 this.isAbstract = isAbstract;
37 public boolean isAbstract() {
42 public List<Parameter> getParameters() {
47 public int hashCode() {
50 result = prime * result + Objects.hashCode(getName());
51 result = prime * result + Objects.hashCode(params);
52 result = prime * result + Objects.hashCode(getReturnType());
57 public boolean equals(final Object obj) {
64 if (getClass() != obj.getClass()) {
67 MethodSignatureImpl other = (MethodSignatureImpl) obj;
68 if (!Objects.equals(getName(), other.getName())) {
71 if (!Objects.equals(params, other.params)) {
74 if (!Objects.equals(getReturnType(), other.getReturnType())) {
81 public String toString() {
82 StringBuilder builder = new StringBuilder();
83 builder.append("MethodSignatureImpl [name=");
84 builder.append(getName());
85 builder.append(", comment=");
86 builder.append(getComment());
87 if (getDefiningType() != null) {
88 builder.append(", definingType=");
89 builder.append(getDefiningType().getPackageName());
91 builder.append(getDefiningType().getName());
93 builder.append(", definingType= null");
95 builder.append(", returnType=");
96 builder.append(getReturnType());
97 builder.append(", params=");
98 builder.append(params);
99 builder.append(", annotations=");
100 builder.append(getAnnotations());
102 return builder.toString();