Success<S, E> class final

Success Result.

return it when the result of a Result is the expected value.

Inheritance

Constructors

Success(S _success)
Receives the S param as the successful result.
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
success → S
Success value
no setter

Methods

getOrThrow() → S
Get the S value IF it is a Success.
override
isError() bool
Returns true if the current result is an Error.
override
isSuccess() bool
Returns true if the current result is a Success.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
tryGetError() → E?
Returns the value of E if any.
override
tryGetSuccess() → S
Returns the value of S if any.
override
when<W>(SuccessCallback<W, S> whenSuccess, ErrorCallback<W, E> whenError) → W
Handle the result when success or error
override
whenError<R>(R whenError(E error)) → R?
Execute whenError if the Result is an error.
override
whenSuccess<R>(R whenSuccess(S success)) → R
Execute whenSuccess if the Result is a success.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

unit<E>() Success<Unit, E>
Build a Success with Unit value.