If this Option is None, perform the action in fn
If this Option is None, perform the action in fn
the action to perform
the wrapped Option (identity)
Wraps the given object in an Option, which resolves to None if the given object reference is null.
Wraps the given object in an Option, which resolves to None if the given object reference is null.
optionally, the wrapped object
If this Option is None, throw the given Throwable; else, return the value inside the Option
If this Option is None, throw the given Throwable; else, return the value inside the Option
the Throwable to potentially throw
the value inside the wrapped Option
if the Option is None
If this Option is none, perform the action in fn
If this Option is none, perform the action in fn
the action to perform
the wrapped Option (identity)
If this Option is Some, perform the action in fn which acts on the value
If this Option is Some, perform the action in fn which acts on the value
the action to perform
the wrapped Option (identity)
Wraps the given object in a Some.
Wraps the given object in a Some.
NOTE: calling .some
on a null value will return Some(null): Some[T]
, which is legal but broken.
This behavior is equivalent to directly crafting a Some[T](null)
, which is also legal but broken.
Overall, prefer .opt
for null safety.
the wrapped object
Map the Option into Future success/fail states: if the Option is a Some, yield a Future with its value; if the Option is None, yield a Future with Throwable t as its failure state
Map the Option into Future success/fail states: if the Option is a Some, yield a Future with its value; if the Option is None, yield a Future with Throwable t as its failure state
the Throwable to potentially wrap as a failure
the Future-wrapped value of this Option, or a Future-wrapped failure Throwable
Extends an Option for side effects based on the optional value.
the type of the optional value