Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Either.when(), as a convenience for Option.when().toEither() #2715

Open
jbrains opened this issue Mar 13, 2022 · 0 comments
Open

Either.when(), as a convenience for Option.when().toEither() #2715

jbrains opened this issue Mar 13, 2022 · 0 comments

Comments

@jbrains
Copy link
Contributor

jbrains commented Mar 13, 2022

I like Option.when(). I would also like Either.when(). Please consider it. I would add it myself, but I don't have the energy right now. I might try later.

Either.when(boolean condition, T ifTrue, Supplier<? extends R> ifFalse) { return Option.when(condition, ifTrue).toEither(ifFalse); }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant