Package org.kiwiproject.beta.base
Class KiwiRunnables.RunResult
- java.lang.Object
-
- org.kiwiproject.beta.base.KiwiRunnables.RunResult
-
- Enclosing class:
- KiwiRunnables
public static class KiwiRunnables.RunResult extends Object
Represents the result of an attempt to run aKiwiRunnables.ThrowingRunnable.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable Exceptionerror()If an error occurred while running an object, this contains theExceptionthat was thrown.booleanhasError()static KiwiRunnables.RunResultofError(Exception exception)Create a new "failed run" instance.static KiwiRunnables.RunResultofSuccess()Create a new "successfully run" instance.booleansuccess()
-
-
-
Method Detail
-
ofSuccess
public static KiwiRunnables.RunResult ofSuccess()
Create a new "successfully run" instance.- Returns:
- a new instance representing a successful run
-
ofError
public static KiwiRunnables.RunResult ofError(Exception exception)
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
-
-