Package net.jqwik.api.lifecycle
Interface AroundPropertyHook
-
- All Superinterfaces:
LifecycleHook
- All Known Implementing Classes:
PerProperty.PerPropertyHook
,PropertyDefaults.PropertyDefaultsHook
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@API(status=EXPERIMENTAL, since="1.0") @FunctionalInterface public interface AroundPropertyHook extends LifecycleHook
Implement this hook to define behaviour that should "wrap" the execution of a property, i.e., do something directly before or after running a property - or both. You can even change the result of a property from successful to failed or the other way round.
-
-
Field Summary
Fields Modifier and Type Field Description static AroundPropertyHook
BASE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PropertyExecutionResult
aroundProperty(PropertyLifecycleContext context, PropertyExecutor property)
When you wrap a property you can do stuff before and/or after its execution.default int
aroundPropertyProximity()
The higher the value, the closer to the actual property method.default int
compareTo(AroundPropertyHook other)
-
Methods inherited from interface net.jqwik.api.lifecycle.LifecycleHook
appliesTo, propagateTo
-
-
-
-
Field Detail
-
BASE
@API(status=INTERNAL) static final AroundPropertyHook BASE
-
-
Method Detail
-
aroundProperty
PropertyExecutionResult aroundProperty(PropertyLifecycleContext context, PropertyExecutor property) throws java.lang.Throwable
When you wrap a property you can do stuff before and/or after its execution. All implementors should invoke the property withproperty.execute()
and either return the result of this call or map it to another result.- Parameters:
context
- The property's context objectproperty
- An executor to run the property- Returns:
- The result of running the property
- Throws:
java.lang.Throwable
-
aroundPropertyProximity
default int aroundPropertyProximity()
The higher the value, the closer to the actual property method. Default value is 0.Values greater than -10 will make it run "inside" annotated lifecycle methods (BeforeProperty and AfterProperty).
- Returns:
- an integer value
-
compareTo
@API(status=INTERNAL) default int compareTo(AroundPropertyHook other)
-
-