Skip to content

Introduction of CheckedConsumerN and ConsumerN #2908

@Koziolek

Description

@Koziolek

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:

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions