OptionOps<A> extension

Additional combinators on Option.

on

Properties

get → A

Available on Option<A>, provided by the OptionOps extension

Returns the value if this is a Some, or throws a StateError if this is a None.
no setter
getOrNull → A?

Available on Option<A>, provided by the OptionOps extension

Returns the value if this is a Some, or null if this is a None.
no setter

Methods

contains(A elem) bool

Available on Option<A>, provided by the OptionOps extension

getOrElse(Function0<A> ifEmpty) → A

Available on Option<A>, provided by the OptionOps extension

Returns the value if this is a Some or the value returned from evaluating ifEmpty.
orElse(Function0<Option<A>> orElse) Option<A>

Available on Option<A>, provided by the OptionOps extension

If this is a Some, this is returned, otherwise the result of evaluating orElse is returned.