Skip to content

Allow consumer to use all terminal ops #19

@hanfak

Description

@hanfak

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions