this Option
import com.paypal.cascade.common.option._ val a = Some(true) a.orFalse // => true, from the value in a a.orTrue // => true still, from the value in a val b = None b.orFalse // => false, because b is not defined b.orTrue // => true, because b is not defined
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
Either the value inside this option, or false
Either the value inside this option, or false
the value inside this option, or false
Either the value inside this option, or true
Either the value inside this option, or true
the value inside this option, or true
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 Option[Boolean] types