Returns the value if present, otherwise invokes the supplier function and returns its result.
Example:
var empty = Optional.empty<string> ();
var val = empty.orElseGet (() => { return "computed"; });
| supplier |
a function that produces a default value. |
|
the value if present, otherwise the supplier result. |