All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.holmes.exception.ValidationException Maven / Gradle / Ivy

Go to download

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