2 * Copyright (c) 2016 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.binding2.generator.util.generated.type.builder;
11 import com.google.common.annotations.Beta;
12 import java.util.Objects;
13 import org.opendaylight.mdsal.binding2.model.api.MethodSignature.Parameter;
14 import org.opendaylight.mdsal.binding2.model.api.Type;
17 final class MethodParameterImpl implements Parameter {
19 private final String name;
20 private final Type type;
22 public MethodParameterImpl(final String name, final Type type) {
30 public String getName() {
35 public Type getType() {
40 public int hashCode() {
41 return Objects.hash(name, type);
45 public boolean equals(final Object obj) {
52 if (getClass() != obj.getClass()) {
55 if (!(obj instanceof MethodParameterImpl)) {
58 MethodParameterImpl other = (MethodParameterImpl) obj;
59 return Objects.equals(name, other.name) && Objects.equals(type, other.type);
63 public String toString() {
64 StringBuilder builder = new StringBuilder();
65 builder.append("MethodParameter [name=");
67 builder.append(", type=");
68 builder.append(type.getPackageName());
70 builder.append(type.getName());
72 return builder.toString();