2 * Copyright (c) 2017 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.binding.javav2.generator.util.generated.type.builder;
11 import com.google.common.annotations.Beta;
12 import java.util.Objects;
13 import org.opendaylight.mdsal.binding.javav2.model.api.MethodSignature.Parameter;
14 import org.opendaylight.mdsal.binding.javav2.model.api.Type;
17 final class MethodParameterImpl implements Parameter {
19 private final String name;
20 private final Type type;
22 MethodParameterImpl(final String name, final Type type) {
28 public String getName() {
33 public Type getType() {
38 public int hashCode() {
39 return Objects.hash(name, type);
43 public boolean equals(final Object obj) {
50 if (getClass() != obj.getClass()) {
53 if (!(obj instanceof MethodParameterImpl)) {
56 MethodParameterImpl other = (MethodParameterImpl) obj;
57 return Objects.equals(name, other.name) && Objects.equals(type, other.type);
61 public String toString() {
62 StringBuilder builder = new StringBuilder();
63 builder.append("MethodParameter [name=");
65 builder.append(", type=");
66 builder.append(type.getPackageName());
68 builder.append(type.getName());
70 return builder.toString();