All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.codetrans.MethodSignature Maven / Gradle / Ivy

There is a newer version: 4.1.0.Beta1
Show newest version
package io.vertx.codetrans;

import io.vertx.codegen.type.TypeInfo;

import java.util.List;

/**
 * @author Julien Viet
 */
public class MethodSignature {

  final String name;
  final List parameterTypes;
  final boolean varargs;
  final TypeInfo returnType;

  public MethodSignature(String name, List parameterTypes, boolean varargs, TypeInfo returnType) {
    this.name = name;
    this.parameterTypes = parameterTypes;
    this.varargs = varargs;
    this.returnType = returnType;
  }

  public String getName() {
    return name;
  }

  public List getParameterTypes() {
    return parameterTypes;
  }

  public TypeInfo getReturnType() {
    return returnType;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj instanceof MethodSignature) {
      MethodSignature that = (MethodSignature) obj;
      return name.equals(that.name) && parameterTypes.equals(that.parameterTypes) && varargs == that.varargs;
    }
    return false;
  }

  @Override
  public int hashCode() {
    return name.hashCode() + 31 * (parameterTypes.hashCode() + (31 * (varargs ? 1 : 0)));
  }

  @Override
  public String toString() {
    return "MethodSignature[name=" + name + ",parameters=" + parameterTypes + ",varargs=" + varargs + "]";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy