Interface ReturningValidator<R>


  • public interface ReturningValidator<R>
    • Method Detail

      • orElseThrow

        <E extends RuntimeExceptionR 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.
      • orElseReturn

        R orElseReturn​(Function<String,​R> other)
        Parameters:
        other - the backup/default return type if the validation fails with the optional message that is contained in the Validator.
        Returns:
        R the return type.