Constructors MethodsAbstractfilter filter ( predicate ) : Option < T > Parameters predicate : ( ( value : T ) => boolean ) ( value ) : boolean Returns boolean
The original Option<T> if the condition is met, otherwise None.
Abstractflat Map flat Map < U > ( fn ) : Option < U >
The transformed Option<U>, or None if original was None.
Abstractfold fold < U > ( ifNone , ifSome ) : U Parameters ifNone : ( ( ) => U ) ifSome : ( ( value : T ) => U ) Returns U
The result of calling ifNone or ifSome.
Abstractget Or Else get Or Else ( defaultValue ) : T Returns T
The contained value if present, otherwise defaultValue.
Abstractis None is None ( ) : boolean Returns boolean
true if None, otherwise false.
Abstractis Some is Some ( ) : boolean Returns boolean
true if Some, otherwise false.
Abstractmap map < U > ( fn ) : Option < U >
The transformed Option<U>, or None if original was None.
Abstractor Else or Else ( alternative ) : Option < T >
The original if Some, otherwise alternative.
Staticfrom from < T > ( value ) : Option < T >
Some<T> if valid, otherwise None.
Represents an optional value (
Some<T>for present values,Nonefor absence). Implements a functional-style API for safe operations without null checks.