GFailure<T, E> class
final
- Inheritance
- Available extensions
Properties
- error → E
-
The failure error.
final
- errorOrNull → E?
-
Returns the failure error if present, or
null.no setterinherited - hashCode → int
-
The hash code for this object.
no setteroverride
- isFailure → bool
-
Returns
trueif this result is GFailure.no setterinherited - isSuccess → bool
-
Returns
trueif this result is GSuccess.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- valueOrNull → T?
-
Returns the success value if present, or
null.no setterinherited
Methods
-
filter(
bool predicate(T value), {required E orElse(T value)}) → GResult< T, E> -
Demotes a success that fails
predicateinto a failure built byorElse.inherited -
flatMap<
R> (GResult< R, E> fn(T value)) → GResult<R, E> -
Binds a function that returns a GResult.
inherited
-
flatMapAsync<
R> (FutureOr< GResult< transform(T value)) → Future<R, E> >GResult< R, E> > -
Available on GResult<
Asynchronously chains a success into another GResult.T, E> , provided by the GmanaResultX extension -
fold<
R> ({required R onSuccess(T value), required R onFailure(E error)}) → R -
Collapses both branches into a single value of type
R.inherited -
getOrElse(
T fallback) → T -
Returns the success value, or
fallbackif this is a GFailure.inherited -
getOrElseGet(
T fallback(E error)) → T -
Available on GResult<
Returns the success value, or lazily creates a fallback from the error.T, E> , provided by the GmanaResultX extension -
getOrThrow(
) → T -
Returns the success value, or throws the failure error.
inherited
-
inspectFailure(
void action(E error)) → GResult< T, E> -
Available on GResult<
RunsT, E> , provided by the GmanaResultX extensionactionfor a GFailure, then returns this result unchanged. -
inspectSuccess(
void action(T value)) → GResult< T, E> -
Available on GResult<
RunsT, E> , provided by the GmanaResultX extensionactionfor a GSuccess, then returns this result unchanged. -
map<
R> (R fn(T value)) → GResult< R, E> -
Transforms the success value using
fn.inherited -
mapAsync<
R> (FutureOr< R> transform(T value)) → Future<GResult< R, E> > -
Available on GResult<
Asynchronously transforms a success value usingT, E> , provided by the GmanaResultX extensiontransform. -
mapBoth<
R, F> ({required R onSuccess(T value), required F onFailure(E error)}) → GResult< R, F> -
Transforms whichever branch is present.
inherited
-
mapError<
F> (F fn(E error)) → GResult< T, F> -
Transforms the error using
fn.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recover(
T transform(E error)) → GResult< T, E> -
Available on GResult<
Converts a GFailure into a GSuccess usingT, E> , provided by the GmanaResultX extensiontransform. -
recoverWith(
GResult< T, E> transform(E error)) → GResult<T, E> -
Available on GResult<
Replaces a GFailure with the result returned byT, E> , provided by the GmanaResultX extensiontransform. -
swap(
) → GResult< E, T> -
Exchanges the success and failure branches.
inherited
-
toEither(
) → Either< E, T> -
Available on GResult<
Converts this GResult to an Either, mapping GSuccess to Right and GFailure to Left.T, E> , provided by the GmanaResultToEitherX extension -
toString(
) → String -
A string representation of this object.
override
-
when<
R> ({required R onSuccess(T value), required R onFailure(E error)}) → R -
Pattern-matches over the result.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override