com.transferwise.tasks.JavaxValidationEnvironmentValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tw-tasks-core Show documentation
Show all versions of tw-tasks-core Show documentation
Transferwise Tasks Executor - Fire and forget until Alert.
The newest version!
package com.transferwise.tasks;
import javax.validation.ConstraintViolationException;
import javax.validation.Validator;
import org.springframework.beans.factory.annotation.Autowired;
public class JavaxValidationEnvironmentValidator extends BaseEnvironmentValidator {
@Autowired
private Validator validator;
@Override
public void validate() {
var violations = validator.validate(tasksProperties);
if (!violations.isEmpty()) {
throw new ConstraintViolationException(violations);
}
super.validate();
}
}