November 19, 2021

Let user handle null case, using functional programming in modern java

When pass an object to a function, then there is a scenario which always arises. That, the passed object could be null. And, we have to write logic to react to that null-condition. And, generally that logic is hard-coded in the function. And, there are times as a user I feel that, instead of throwing an exception […]

Read more
December 11, 2018

How to use or implement java.util.function.BiConsumer interface in java.

BiConsumer is a Functional Interface . It has two methods, one abstract and other one is default method. void accept(T parameter1, U parameter2) :- It accepts two parameters and does not return anything. default BiConsumer<T, U> andThen(BiConsumer< ? super T, ? super U> applyThisAfterProcessing) :-  This function takes one BiConsumer and returns another BiConsumer .The BiConsumer , which is passed in as an argument […]

Read more