News for hackers. Stuff that matters.
Re:Modern Java – A Guide to Java 8 by incepted on Tuesday November 17, 2015 @12:03AM (#10579261)
Actually, your way is awfully more verbose, but you didn't notice it because you ellipsized the verbosity.

If you actually take the time to translate OP's code with your own, you will soon find yourself indented six levels with "if (a != null) { ... if (b != null) { ... if (c != null) {...

You get the idea.

Monads (the type class that Optional belongs to) flatten all this boiler plate with a function called... flatMap! And you don't even need to know about it, all you need to do is chain the calls like OP did:

    Optional.ofNullable(paramater)
                       .filter(...)
                       .map(a -> ...)
                       .map(b -> ...)
                       .orElseGet(() -> ...)
                       .orElse(defaultValue)
without having to check against null every step along the way.
Re:Modern Java – A Guide to Java 8 by norswap on Tuesday November 17, 2015 @05:42PM (#10584548)
Point taken. I'll tentatively argue if all your functions can return null you have other problems to contend with, but what you said makes sense.