org.embulk.config.TaskValidationException Maven / Gradle / Ivy
package org.embulk.config;
import java.util.Set;
import javax.validation.ConstraintViolation;
public class TaskValidationException extends ConfigException {
@SuppressWarnings("unchecked")
private final Set violations;
public TaskValidationException(Set> violations) {
super(formatMessage(violations));
this.violations = violations;
}
@SuppressWarnings("unchecked")
public Set> getViolations() {
return violations;
}
private static String formatMessage(Set> violations) {
StringBuilder sb = new StringBuilder();
sb.append("Configuration task validation failed.");
for (ConstraintViolation violation : violations) {
sb.append(" ");
sb.append(violation.getPropertyPath());
sb.append(" ");
sb.append(violation.getMessage());
sb.append(" but got ");
sb.append(violation.getInvalidValue());
}
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy