#flatmap

Steinar Bangsteinarb
2022-01-23

Chaining Optionals using flatMap and map steinar.bang.priv.no/?p=461 The blog post How I learnt to like Optional shows an example of how to chain Optional values safely, using Optional.orElse() to provide empty objects for the next level in the chain. This blog post uses Optional.flatMap() and Optional.map(), to achieve the same thing, without having to create the empty objects, and withou

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst