Returns the value if present, otherwise returns the given default value.
Example:
var empty = Optional.empty<string> ();
assert (empty.orElse ("default") == "default");
| other |
the default value. |
|
the value if present, otherwise other. |