Package org.solidcoding.validation.api
Interface ReturningValidator<R>
-
public interface ReturningValidator<R>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RorElseReturn(Function<String,R> other)RorElseReturn(R other)<E extends RuntimeException>
RorElseThrow(E throwable)
-
-
-
Method Detail
-
orElseThrow
<E extends RuntimeException> R orElseThrow(E throwable)
- Type Parameters:
E- the bound of the Exception that needs to be thrown when a rule is broken.- Parameters:
throwable- the Exception that needs to be thrown when a rule is broken.- Returns:
- R the return type
-
orElseReturn
R orElseReturn(R other)
- Parameters:
other- the backup/default return type if the validation fails.- Returns:
- R the return type.
-
-