@API(status=EXPERIMENTAL, since="1.2.3") @FunctionalInterface public interface AroundTryHook extends LifecycleHook
Modifier and Type | Field and Description |
---|---|
static AroundTryHook |
BASE |
Modifier and Type | Method and Description |
---|---|
TryExecutionResult |
aroundTry(TryLifecycleContext context,
TryExecutor aTry,
java.util.List<java.lang.Object> parameters)
When you wrap a try you can do stuff before and/or after its execution.
|
default int |
aroundTryProximity()
The higher the value, the closer to the actual property method.
|
default int |
compareTo(AroundTryHook other) |
appliesTo, propagateTo
@API(status=INTERNAL) static final AroundTryHook BASE
TryExecutionResult aroundTry(TryLifecycleContext context, TryExecutor aTry, java.util.List<java.lang.Object> parameters) throws java.lang.Throwable
aTry.execute(parameters)
and either return the result of this call or create another result.
It is possible to manipulate the parameters
before invoking
aTry.execute(parameters)
.
Never change the number and types of parameters because this will result
in runtime errors.
Also keep in mind that
all manipulation might mess up random generation and shrinking.
context
- The property's context objectaTry
- executor to callparameters
- the generated parameters for this tryjava.lang.Throwable
default int aroundTryProximity()
Values greater than -10 will make it run "inside" annotated lifecycle methods (BeforeTry and AfterTry).
@API(status=INTERNAL) default int compareTo(AroundTryHook other)