RECOVER_TYPE
- The return type of the recover functions.public class FailureReport<RECOVER_TYPE> extends Object
recoverable()
, retryWith(java.util.function.Supplier<RECOVER_TYPE>)
or continueWith(java.util.function.Supplier<RECOVER_TYPE>)
.Constructor and Description |
---|
FailureReport() |
Modifier and Type | Method and Description |
---|---|
FailureReport<RECOVER_TYPE> |
cause(Exception cause)
Supplies the exception that caused or indicated the failure.
|
FailureReport<RECOVER_TYPE> |
continueWith(Runnable continueAt)
Reports that the failure is recoverable by continuing by running
continueAt
. |
FailureReport<RECOVER_TYPE> |
continueWith(Supplier<RECOVER_TYPE> continueAt)
Reports that the failure is recoverable by continuing by running
continueAt
. |
FailureReport<RECOVER_TYPE> |
details(String message,
Object... values)
Supplies a message giving details about the failure.
|
Supplier<RECOVER_TYPE> |
getContinueRoutine()
Gets the function that lets Beagle continue the analysis by skipping the failed
action.
|
String |
getDetails()
Gets the report’s failure details.
|
Exception |
getFailureCause()
Gets the exception that caused or indicated the reported failure.
|
String |
getFailureMessage()
Gets the report’s failure description.
|
Supplier<RECOVER_TYPE> |
getRetryRoutine()
Gets the function that lets Beagle retry the failed failed action.
|
FailureReport<RECOVER_TYPE> |
message(String message,
Object... values)
Supplies a message describing the failure.
|
FailureReport<RECOVER_TYPE> |
recoverable()
Reports that the failure is recoverable by continuing the normal control flow after
the failure handling.
|
FailureReport<RECOVER_TYPE> |
retryWith(Runnable retryAt)
Reports that the failure is recoverable by retrying the failed action by running
retryAt . |
FailureReport<RECOVER_TYPE> |
retryWith(Supplier<RECOVER_TYPE> retryAt)
Reports that the failure is recoverable by retrying the failed action by running
retryAt . |
public FailureReport<RECOVER_TYPE> message(String message, Object... values)
String.format(String, Object...)
.message
- A message describing the failure. Must not be null
.values
- Format values, will be passed to
String.format(String, Object...)
.this
.public FailureReport<RECOVER_TYPE> details(String message, Object... values)
String.format(String, Object...)
and be perepended to
potentally already existing details.message
- Details about the reported failure.values
- Format values, will be passed to
String.format(String, Object...)
.this
.public FailureReport<RECOVER_TYPE> cause(Exception cause)
cause.getMessage()
. The exception’s stacktrace will be appnended to the
report’s details. A new report’s cause is
null
.cause
- The exception that caused or indicated the failure. Must not be
null
.this
.public FailureReport<RECOVER_TYPE> recoverable()
null
as the result
of handling this report.this
.public FailureReport<RECOVER_TYPE> continueWith(Supplier<RECOVER_TYPE> continueAt)
continueAt
.continueAt
- A function defining how to continue while skipping the failed
action. Supplies the value the failure reporter should use instead of
the one that was expected to be generated skipped action.this
.public FailureReport<RECOVER_TYPE> continueWith(Runnable continueAt)
continueAt
. The failure reporter will receive null
as the result of handling this
report.continueAt
- A runnable defining how to continue while skipping the failed
action.this
.public FailureReport<RECOVER_TYPE> retryWith(Supplier<RECOVER_TYPE> retryAt)
retryAt
.retryAt
- A function defining how to retry the failed action. Supplies the
value the reporter should use instead of the one that was expected to be
generated by the failed action.this
.public FailureReport<RECOVER_TYPE> retryWith(Runnable retryAt)
retryAt
. The failure reporter will receive null
as the result of
handling this report.retryAt
- A runnable defining how to retry the failed action.this
.public String getFailureMessage()
null
indicates that there’s no
information available.message(String, Object...)
public String getDetails()
null
indicates that there’s no
information available.details(String, Object...)
public Exception getFailureCause()
null
indicates that the reported failure was
not caused by an exception.cause(Exception)
public Supplier<RECOVER_TYPE> getContinueRoutine()
null
indicates that Beagle
cannot continue without the failed action.recoverable()
,
continueWith(Runnable)
public Supplier<RECOVER_TYPE> getRetryRoutine()
null
indicates that the failed action cannot be retried.retryWith(Runnable)