Skip to content

What are the use cases for methods with BooleanSupplier parameter? #2552

Answered by sbrannen
Marcono1234 asked this question in Q&A
Discussion options

You must be logged in to vote

the only reasonable use case I can think of are classes which actually implement BooleanSupplier

That is one category of use cases: types that implement BooleanSupplier.

Another category of use cases includes methods that return a BooleanSupplier.

In all other use cases it would be easier to directly provide the boolean value.

Yes, if you already have the boolean or Boolean, there is no need to wrap it in a BooleanSupplier.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Marcono1234
Comment options

Answer selected by sbrannen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants