Readonly
valueApplies the given function to the value contained in the Option
if it is Some
.
If the Option
is None
, it returns a new Option
with a null
value.
An Option
that contains the result of applying the function, or a new Option
with a null
value.
Throws an error with the specified message if the option is None. Otherwise, returns the value of the option.
The error message to throw if the option is None.
The value of the option if it is Some.
Error with the specified message if the option is None.
Filters the option based on the given predicate function. If the predicate returns true for the option's value, returns the current option. If the predicate returns false for the option's value, returns a new empty option.
The predicate function to filter the option.
The filtered option.
Checks if the Option is Some and satisfies the given predicate.
The predicate function to test the value with.
true
if the Option is Some and the value satisfies the predicate, false
otherwise.
Returns a new Option that represents the exclusive or (XOR) operation between this Option and the provided Option.
If one of the Options is Some
and the other is None
, it returns the Some
Option.
If both Options are Some
or both are None
, it returns a new None
Option.
A new Option representing the XOR operation between this Option and the provided Option.
Static
fromStatic
isStatic
matchStatic
noneStatic
some
Represents an optional value that may or may not exist.