Interface ThrowingValidator<R>
-
- All Known Subinterfaces:
ContinuingValidationBuilder<T>,ReturningValidationBuilder<T>,VoidValidationBuilder
public interface ThrowingValidator<R>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <E extends RuntimeException>
RorElseThrow(Function<String,E> throwableFunction)
-
-
-
Method Detail
-
orElseThrow
<E extends RuntimeException> R orElseThrow(Function<String,E> throwableFunction)
- Type Parameters:
E- the bound of the Exception that needs to be thrown when a rule is broken.- Parameters:
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.- Returns:
- true if all rules pass.
-
-