Package org.kiwiproject.beta.base
Class KiwiRunnables.RunResult
java.lang.Object
org.kiwiproject.beta.base.KiwiRunnables.RunResult
- Enclosing class:
- KiwiRunnables
Represents the result of an attempt to run a
KiwiRunnables.ThrowingRunnable.-
Method Summary
Modifier and TypeMethodDescription@Nullable Exceptionerror()If an error occurred while running an object, this contains theExceptionthat was thrown.booleanhasError()static KiwiRunnables.RunResultCreate a new "failed run" instance.static KiwiRunnables.RunResultCreate a new "successfully run" instance.booleansuccess()
-
Method Details
-
ofSuccess
Create a new "successfully run" instance.- Returns:
- a new instance representing a successful run
-
ofError
Create a new "failed run" instance.- Parameters:
exception- the error that occurred while running an object- Returns:
- a new instance representing the failed run
-
success
public boolean success()- Returns:
- true if the operation succeeded, otherwise false
-
hasError
public boolean hasError()- Returns:
- true if the operation failed, otherwise false
-
error
If an error occurred while running an object, this contains theExceptionthat was thrown. If there was no error, this will benull.
-