-
-
Notifications
You must be signed in to change notification settings - Fork 656
Open
Description
First read this one. Now, let's discuss the introduction of CheckedConsumerN and ConsumerN.
Motivation
There are some tickets that touch peek/tap functionality for:
- Tuples – Peek() or tap() for tuples #2723
- Functions – Add variadic <T1, T2, ...TN> peek()/tap() to FunctionN #2755
I tried to implement that for Tuple using FunctionN<params, Void> in Koziolek@8f8a2fd and I use Function because of lack of (Checked)ConsumerN.
Introduction of those consumers gives more flexibility not only for peek/tap functionality, but in the future it will be possible to introduce functionalities similar to forEach but for tuples to emulate object decomposition.
Current status
We have CheckedConsumer that takes one param. We cannot remove if because of backward compatibility, but it could be marked as deprecated and replaced by CheckedConsumer1
Metadata
Metadata
Assignees
Labels
No labels