Type parameter for main value.
Successed data of this object
Return Resultt instance with doing consumer
.
Return [Failure] if the argument predicate
is evaluated as false.
Internally the method filter
throws runtime Error
ValueNotFoundException
if the predicate is false.
Return [Failure] if a value of this Resultt
instance is null;
Map the value of this result to another instance typed R. If this function cannot return another instance, throw Error.
higher kinded function for succesing
higher kinded function for failing
Get Failure
instance initialized with ValueNotFoundException
.
Get the value of this result or default value in argument
Get the value of type R by applying action.
Shorthand for the method fold
.
the action on failure
Get the encapsulated value of this class instance if success.
Get a value of this result or throw error if not.
Some Error if want. No parameter passed throw default Error.
Return true if the result was failed.
Return true if the result was successed.
Map the result to another result, transforming by the argument.
callback function for mapping another Result.
Map the result to another result, transforming by the argument.
mapCatching
handle errors on executing the argument transform
.
callback function for mapping another Result.
Set action on failure.
action on failure.
Set an additional action on successing
callback function for mapping another Result.
callback function for mapping another Result.
Return the string expression of this class instance.
Create Failure instance manually
error
Failure
Wrapping actions and return Result instance. Force the first type parameter type of Error when the action result catch Error.
function to be called
The result of execution in argument supplier.
Generated using TypeDoc
Base class for runtime result. This class may express the context for a runtime and its result.
Highly inspired by Kotlin Result/runCatching.
usage ... test/appliation/result-test.ts