Success<S, F extends Exception> class
final
A success, storing a Success value.
Constructors
- Success(S value)
Properties
- failure → F
-
Returns a new value of Failure result.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- isFailure → bool
-
Returns true if Result is Failure.
no setterinherited
- isSuccess → bool
-
Returns true if Result is Success.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- success → S
-
Returns a new value of Success result.
no setterinherited
- value → S
-
final
Methods
-
flatMap<
U, E extends Exception> (Result< U, F> transform(S)) → Result<U, F> -
Maps a Result<S, F> to Result<U, F> by applying a function
to a contained Success value and unwrapping the produced result,
leaving an Failure value untouched.
inherited
-
flatMapError<
V, E extends Exception> (Result< S, E> transform(F)) → Result<S, E> -
Maps a Result<S, F> to Result<S, E> by applying a function
to a contained Failure value, leaving an Success value untouched.
inherited
-
map<
U, E extends Exception> (U transform(S)) → Result< U, F> -
Maps a Result<S, F> to Result<U, F> by applying a function
to a contained Success value, leaving an Failure value untouched.
This function can be used to compose the results of two functions.
inherited
-
mapError<
V, E extends Exception> (E transform(F)) → Result< S, E> -
Maps a Result<S, F> to Result<S, E> by applying a function
to a contained Failure value, leaving an Success value untouched.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
result(
Completion< S> success, Completion<F> failure) → void -
Returns a new value of Result from closure
either a success or a failure.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
unwrap(
) → S -
Unwraps the Result and returns the Success value.
inherited
-
unwrapOr<
T> (T initial) → S -
Unwraps the Result and returns the Success value.
If the result is a Success, returns the success value.
If the result is a Failure, returns the provided
initial
value as a Success.inherited -
unwrapOrElse<
T extends Object> (T t, S operation(T)) → S -
Unwraps the Result and returns the Success value.
If the result is a Success, returns the success value.
If the result is a Failure, returns the provided
initial
value as a Success.inherited
Operators
-
operator ==(
Object o) → bool -
The equality operator.
override