org.hibernate.validator.internal.properties.Signature Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-validator Show documentation
Show all versions of hibernate-validator Show documentation
JPMS Module-Info's for a few of the Jakarta Libraries. These will be removed as time goes by
/*
* Hibernate Validator, declare and validate application constraints
*
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or .
*/
package org.hibernate.validator.internal.properties;
import java.util.Arrays;
public final class Signature {
private final String name;
private final Class>[] parameterTypes;
public Signature(String name, Class>... parameterTypes) {
this.name = name;
this.parameterTypes = parameterTypes;
}
@Override
public boolean equals(Object obj) {
if ( obj == null ) {
return false;
}
// we can safely assume the type will always be the right one
Signature other = (Signature) obj;
if ( !this.name.equals( other.name ) ) {
return false;
}
return Arrays.equals( this.parameterTypes, other.parameterTypes );
}
@Override
public int hashCode() {
int result = name.hashCode();
result = 31 * result + Arrays.hashCode( parameterTypes );
return result;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy