Class PerProperty.PerPropertyHook

    • Constructor Detail

      • PerPropertyHook

        public PerPropertyHook()
    • Method Detail

      • aroundProperty

        public PropertyExecutionResult aroundProperty​(PropertyLifecycleContext context,
                                                      PropertyExecutor property)
        Description copied from interface: AroundPropertyHook
        When you wrap a property you can do stuff before and/or after its execution. All implementors should invoke the property with property.execute() and either return the result of this call or map it to another result.
        Specified by:
        aroundProperty in interface AroundPropertyHook
        Parameters:
        context - The property's context object
        property - An executor to run the property
        Returns:
        The result of running the property
      • resolve

        public java.util.Optional<ResolveParameterHook.ParameterSupplier> resolve​(ParameterResolutionContext parameterContext,
                                                                                  LifecycleContext lifecycleContext)
        Description copied from interface: ResolveParameterHook
        This method will be called only once per property, whereas the returned supplier's get method is usually invoked for each try - and potentially more often during shrinking or when resolving parameters in before/after methods. The returned supplier should always return an equivalent object, i.e. an object that behaves the same when used in the same way.
        Specified by:
        resolve in interface ResolveParameterHook
        Parameters:
        parameterContext - Contains information of parameter to resolve
        lifecycleContext - Can be of type ContainerLifecycleContext or PropertyLifecycleContext
        Returns:
        supplier instance wrapped in Optional or Optional.empty() if it cannot be resolved