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 throw an IllegalArgumentException. Therefore, only use .some
when
you absolutely know that the parameter is a constant and always will be.
Overall, prefer .opt
for null safety.
the wrapped object
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
(any2Option: Any2Option[Any2Option[T]]).opt
Wraps the given object in a Some.
Wraps the given object in a Some.
NOTE: calling .some
on a null value will throw an IllegalArgumentException. Therefore, only use .some
when
you absolutely know that the parameter is a constant and always will be.
Overall, prefer .opt
for null safety.
the wrapped object
(any2Option: Any2Option[Any2Option[T]]).some
Allows any object to be wrapped in a Some or an Option. Note that some objects provide their own
toOption
or similar methods; provided methods should be preferred over these implicits, in these cases.the wrapped object's type, and the type of the resulting Option