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.controller.binding.generator.util.generated.type.builder;
10 import org.opendaylight.controller.sal.binding.model.api.Type;
11 import org.opendaylight.controller.sal.binding.model.api.MethodSignature.Parameter;
13 final class MethodParameterImpl implements Parameter {
15 private final String name;
16 private final Type type;
18 public MethodParameterImpl(final String name, final Type type) {
25 public String getName() {
30 public Type getType() {
37 * @see java.lang.Object#hashCode()
40 public int hashCode() {
43 result = prime * result + ((name == null) ? 0 : name.hashCode());
44 result = prime * result + ((type == null) ? 0 : type.hashCode());
51 * @see java.lang.Object#equals(java.lang.Object)
54 public boolean equals(Object obj) {
61 if (getClass() != obj.getClass()) {
64 MethodParameterImpl other = (MethodParameterImpl) obj;
66 if (other.name != null) {
69 } else if (!name.equals(other.name)) {
73 if (other.type != null) {
76 } else if (!type.equals(other.type)) {
85 * @see java.lang.Object#toString()
88 public String toString() {
89 StringBuilder builder = new StringBuilder();
90 builder.append("MethodParameter [name=");
92 builder.append(", type=");
93 builder.append(type.getPackageName());
95 builder.append(type.getName());
97 return builder.toString();