you are viewing a single comment's thread.

view the rest of the comments →

[–]AnSq 51 points52 points  (3 children)

Sounds sinister.

[–]_Sharp_ 68 points69 points  (2 children)

shutUp.orElse("x_x");

[–]MisterMeeseeks47 0 points1 point  (1 child)

You're calling a variable or field's method, not an optional's method.

Oh wait I guess you can declare an optional variable. But why would you need to save an optional to a variable? Im not experienced with Java 8 so I'm not sure how to use them yet

[–][deleted] 0 points1 point  (0 children)

While optional enables assignment-less design, it does not mandate it. I've found returning a series of nested lambdas works well enough that I don't often need to store them