--

Yeah, We can use Optional If present method but, we can't directory get the return value. If we want we need to use map as well there.

return Optional.ofNullable(value).map(mapperFunction).orElse(nullFunction)

Other thing, I provided a simple example, you can check the repo. there are some other functionalities as well.

--

--

Responses (1)