org.holmes.exception.ValidationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of holmes-validation Show documentation
Show all versions of holmes-validation Show documentation
Holmes is a library that provides a simple and fluent API for writing business rules validations on Java projects.
The newest version!
package org.holmes.exception;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
/**
* Class that represents a validation case exception.
*
* @author diegossilveira
*/
public class ValidationException extends RuntimeException {
private static final long serialVersionUID = 3422556211439163240L;
private final Set violationsDescriptors;
public ValidationException(Collection violationsDescriptors) {
this.violationsDescriptors = new LinkedHashSet(violationsDescriptors);
}
public Set getViolationsDescriptors() {
return Collections.unmodifiableSet(violationsDescriptors);
}
@Override
public String getMessage() {
return this.toString();
}
@Override
public String toString() {
return violationsDescriptors.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy