Some<T> class
- Inheritance
-
- Available extensions
Constructors
-
Some(T _value)
-
const
Properties
-
hashCode
→ int
-
The hash code for this object.
no setteroverride
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
→ T
-
Extract value of type
T
inside the Some.
no setter
Methods
-
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
a
to change the value of type T
to
a value of type B
.
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
-
extend<Z>(Z f(Option<T> t))
→ Option<Z>
-
Change the value of Option from type
T
to type Z
based on the
value of Option<T>
using function f
.
override
-
filter(bool f(T t))
→ Option<T>
-
If this Option is a Some and calling
f
returns true
, 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
f
returns 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
onSome
when value is Some, otherwise execute onNone
.
inherited
-
isNone()
→ bool
-
Return
true
when value is None.
override
-
isSome()
→ bool
-
Return
true
when value is Some.
override
-
map<B>(B f(T t))
→ Option<B>
-
Change the value of type
T
to a value of type B
using function f
.
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
T
and the
value of type C
of 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 type C
of a second Option, and the value of type D
of a third Option.
override
-
match<B>(B onNone(), B onSome(T t))
→ B
-
Execute
onSome
when value is Some, otherwise execute onNone
.
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
f
returns 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
T
when this Option is a Some, null
otherwise.
override
-
toString()
→ String
-
A string representation of this object.
override
-
toTaskOption()
→ TaskOption<T>
-
Convert this Option to a TaskOption.
override