Implements fold across a pair of Options
Implements fold across a pair of Options
the resulting type of this fold
if both Options are defined
if only the first Option is defined
if only the second Option is defined
if neither is defined
the result of a pattern match over a pair
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
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
Convenience methods for working with pairs of Options.