io.dropwizard.configuration.ConfigurationValidationException Maven / Gradle / Ivy
package io.dropwizard.configuration;
import io.dropwizard.validation.ConstraintViolations;
import javax.validation.ConstraintViolation;
import java.util.Set;
/**
* An exception thrown where there is an error validating a configuration object.
*/
public class ConfigurationValidationException extends ConfigurationException {
private final Set> constraintViolations;
/**
* Creates a new ConfigurationException for the given path with the given errors.
*
* @param path the bad configuration path
* @param errors the errors in the path
*/
public ConfigurationValidationException(String path, Set> errors) {
super(path, ConstraintViolations.format(errors));
this.constraintViolations = ConstraintViolations.copyOf(errors);
}
/**
* Returns the set of constraint violations in the configuration.
*
* @return the set of constraint violations
*/
public Set> getConstraintViolations() {
return constraintViolations;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy