Using consumer builder method, only allows Consumer Terminal ops and not all terminal ops (isValid etc)
Should this be less retricting? Is it worth it?
Terminal ops will still have the abiility to access/create the ExceptionAndInput object and thus consumer can access this.
Does not make sense that Terminal ops can come after consumer, as terminal ops dont throw an exception.
Either make new builder flow for terminal ops (isValid, allExceptions etc) which does not all setting of exception, but provides error message
Something like this:
forInput(4)
.couldSatisfy(isEven).because(input -> "Is not even, for input: " + input)
.or(isGreaterThan2).because(input -> "Is not greater than 2, for input: " + input)
.useConsumer(stubLogger::log)
.getAllExceptionMessages()
Using consumer builder method, only allows Consumer Terminal ops and not all terminal ops (isValid etc)
Should this be less retricting? Is it worth it?
Terminal ops will still have the abiility to access/create the ExceptionAndInput object and thus consumer can access this.
Does not make sense that Terminal ops can come after consumer, as terminal ops dont throw an exception.
Either make new builder flow for terminal ops (isValid, allExceptions etc) which does not all setting of exception, but provides error message
Something like this: