Static
emptyFilter the value (if present)
A predicate that returns a truthy value (if the Optional's value should be preserved) or a falsy value (if the Optional's value should be discarded)
The current Optional (if it is not empty and if the filter returns a truthy value) or an empty Optional (if if the current Optional is empty or if the filter returns a falsy value)
Perform an action if the Optional does not contain a value
The action to perform
The current Optional
Perform an action if the Optional contains a value
The action to perform
The current Optional
Check if the Optional is empty
Static
ofGet the value (if present) or fail with a user-friendly error message
Wrapper for an optional value that might or might not be present