net.sf.jsqlparser.util.validation.ValidationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsqlparser Show documentation
Show all versions of jsqlparser Show documentation
JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes.
The generated hierarchy can be navigated using the Visitor Pattern.
/*-
* #%L
* JSQLParser library
* %%
* Copyright (C) 2004 - 2020 JSQLParser
* %%
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
* #L%
*/
package net.sf.jsqlparser.util.validation;
import java.util.Objects;
public class ValidationException extends RuntimeException {
private static final long serialVersionUID = 1L;
public ValidationException(String message, Throwable cause) {
super(message, cause);
}
public ValidationException(String message) {
super(message);
}
public ValidationException(Throwable cause) {
super(cause == null ? null : cause.getMessage(), cause);
}
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
}
if (this == o) {
return true;
}
if (o.getClass().equals(this.getClass())) {
// exact type match!
ValidationException ve = (ValidationException) o;
return Objects.equals(getMessage(), ve.getMessage()) && Objects.equals(getCause(), ve.getCause());
} else {
return false;
}
}
@Override
public int hashCode() {
return getMessage().hashCode() + (getCause() == null ? 0 : getCause().toString().hashCode());
}
@Override
public String toString () {
return getClass().getSimpleName() + ": " + getMessage();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy