Success<S extends Object, F extends Object> class
final
Represents a success.
Properties
- failure → Null
-
The value if this is a
Failure
ornull
otherwise.no setteroverride - hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- success → S
-
The value if this is a
Success
ornull
otherwise.final
Methods
-
bind<
T extends Object> (Result< T, F> function(S success)) → Result<T, F> -
If this is a
Success
, mapsS
to Result, otherwise returnsF
untouched.override -
bindFailure<
T extends Object> (Result< S, T> function(F failure)) → Result<S, T> -
If this is a
Failure
, mapsF
to Result, otherwise returnsS
untouched.override -
map<
T extends Object> (T function(S success)) → Result< T, F> -
If this is a
Success
, mapsS
toT
, otherwise returnsF
untouched.override -
mapFailure<
T extends Object> (T function(F failure)) → Result< S, T> -
If this is a
Failure
, mapsF
toT
, otherwise returnsS
untouched.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pipe<
T extends Object> (Future< Result< function(S success)) → Future<T, F> >Result< T, F> > -
If this is a
Success
, asynchronously mapsS
to Result, otherwise returnsF
untouched.override -
pipeFailure<
T extends Object> (Future< Result< function(F failure)) → Future<S, T> >Result< S, T> > -
If this is a
Failure
, asynchronously mapsF
to Result, otherwise returnsS
untouched.override -
toString(
) → String -
A string representation of this object.
override
-
when(
{Consume< S> success = Result._nothing, Consume<F> failure = Result._nothing}) → void -
Calls
success
if this is aSuccess
, orfailure
if this is aFailure
.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override