org.solidcoding.validation.api.ThrowingValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of solidcoding-validation Show documentation
Show all versions of solidcoding-validation Show documentation
A small package that enables validation of (business) rules through a fluent API.
package org.solidcoding.validation.api;
import java.util.function.Function;
interface ThrowingValidator {
/**
* @param throwableFunction the function defining the Exception that needs to be thrown when a rule is broken. The String is the stored failure message of the validation.
* @param the bound of the Exception that needs to be thrown when a rule is broken.
* @return true if all rules pass.
*/
R orElseThrow(Function throwableFunction);
}