Some<T> class
- Inheritance
- Available extensions
Constructors
- Some(T _value)
-
const
Properties
Methods
-
alt(
Option< T> orElse()) → Option<T> -
Available on Option<
Return the current Option if it is a Some, otherwise return the result ofT> , provided by the FpdartOnOption extensionorElse. -
andThen<
B> (covariant Option< B> then()) → Option<B> -
If this Option is a Some, then return the result of calling
then. Otherwise return None.inherited -
ap<
B> (covariant Option< B Function(T t)> a) → Option<B> -
Apply the function contained inside
ato change the value of typeTto a value of typeB.inherited -
call<
B> (covariant Option< B> chain) → Option<B> -
Chain multiple Options.
inherited
-
chainFirst<
B> (covariant Monad< _OptionHKT, B> chain(T a)) → HKT<_OptionHKT, T> -
inherited
-
duplicate(
) → Option< Option< T> > -
Wrap this Option inside another Option.
inherited
-
elem(
T t, Eq< T> eq) → bool -
Available on Option<
ReturnT> , provided by the FpdartOnOption extensiontruewhen value ofais equal to the value inside the Option. -
extend<
Z> (Z f(Option< T> t)) → Option<Z> -
Change the value of Option from type
Tto typeZbased on the value ofOption<T>using functionf.override -
extract<
T> (K key) → Option< T> -
Available on Option<
Return an Option that conditionally accesses map keys, only if they match the given type.Map< , provided by the FpdartOnOptionMap extensionK, dynamic> > -
extractMap(
K key) → Option< Map< K, dynamic> > -
Available on Option<
Return an Option that conditionally accesses map keys, if they contain a map with the same key type.Map< , provided by the FpdartOnOptionMap extensionK, dynamic> > -
filter(
bool f(T t)) → Option< T> -
If this Option is a Some and calling
freturnstrue, then return this Some. Otherwise return None.override -
filterMap<
Z> (Option< Z> f(T t)) → Option<Z> -
If this Option is a Some and calling
freturns Some, then return this Some. Otherwise return None.override -
flatMap<
B> (covariant Option< B> f(T t)) → Option<B> -
Used to chain multiple functions that return a Option.
override
-
flatMapNullable<
B> (B? f(T t)) → Option< B> -
Return a new Option that calls Option.fromNullable on the result of of the given function
f.inherited -
flatMapThrowable<
B> (B f(T t)) → Option< B> -
Return a new Option that calls Option.tryCatch with the given function
f.inherited -
fold<
B> (B onNone(), B onSome(T t)) → B -
Execute
onSomewhen value is Some, otherwise executeonNone.inherited -
getOrElse(
T orElse()) → T -
Available on Option<
If this Option is a Some then return the value inside the Option. Otherwise return the result ofT> , provided by the FpdartOnOption extensionorElse. -
isNone(
) → bool -
Return
truewhen value is None.override -
isSome(
) → bool -
Return
truewhen value is Some.override -
map<
B> (B f(T t)) → Option< B> -
Change the value of type
Tto a value of typeBusing functionf.override -
map2<
C, D> (covariant Option< C> mc, D f(T t, C c)) → Option<D> -
Change type of this Option based on its value of type
Tand the value of typeCof another Option.override -
map3<
C, D, E> (covariant Option< C> mc, covariant Option<D> md, E f(T t, C c, D d)) → Option<E> -
Change type of this Option based on its value of type
T, the value of typeCof a second Option, and the value of typeDof a third Option.override -
match<
B> (B onNone(), B onSome(T t)) → B -
Execute
onSomewhen value is Some, otherwise executeonNone.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
partition(
bool f(T t)) → (Option< T> , Option<T> ) -
Return a record. If this Option is a Some:
inherited
-
partitionMap<
Z, Y> (Either< Z, Y> f(T t)) → (Option<Z> , Option<Y> ) -
Return a record that contains as first value a Some when
freturns Left, otherwise the Some will be the second value of the tuple.inherited -
pure<
B> (B b) → Option< B> -
Return a Some containing the value
b.inherited -
toEither<
L> (L onLeft()) → Either< L, T> -
Build an Either from Option.
override
-
toIOOption(
) → IOOption< T> -
Convert this Option to a IOOption.
inherited
-
toJson(
Object? toJsonT(T p1)) → Object? -
Converts to Json.
override
-
toNullable(
) → T -
Return value of type
Twhen this Option is a Some,nullotherwise.override -
toString(
) → String -
A string representation of this object.
override
-
toTaskOption(
) → TaskOption< T> -
Convert this Option to a TaskOption.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override