public class ExecutionResult extends Object
Part of the Failsafe SPI.
| Constructor and Description |
|---|
ExecutionResult(Object result,
Throwable failure)
Records an initial execution result where
success is set to true if failure is not null. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
static ExecutionResult |
failure(Throwable failure)
Returns a an ExecutionResult with the
failure set, completed true and success false. |
Throwable |
getFailure() |
Object |
getResult() |
long |
getWaitNanos() |
int |
hashCode() |
boolean |
isComplete() |
boolean |
isNonResult() |
boolean |
isSuccess() |
static ExecutionResult |
success(Object result)
Returns a an ExecutionResult with the
result set, completed true and success true. |
String |
toString() |
ExecutionResult |
with(long waitNanos,
boolean completed,
boolean success)
Returns a copy of the ExecutionResult with the
waitNanos, completed and success values. |
ExecutionResult |
withComplete()
Returns a copy of the ExecutionResult with the value set to true, else this if nothing has changed.
|
ExecutionResult |
withResult(Object result)
Returns a copy of the ExecutionResult with the
result value, and completed and success set to true. |
public static ExecutionResult success(Object result)
result set, completed true and success true.public static ExecutionResult failure(Throwable failure)
failure set, completed true and success false.public Object getResult()
public Throwable getFailure()
public long getWaitNanos()
public boolean isComplete()
public boolean isNonResult()
public boolean isSuccess()
public ExecutionResult withResult(Object result)
public ExecutionResult withComplete()
public ExecutionResult with(long waitNanos, boolean completed, boolean success)
waitNanos, completed and success values.Copyright © 2019. All rights reserved.