-
public final class Interceptor.Builder<INTERACTION extends Object, ASSERTION extends Object, ACTION extends Object>Builder class that is used to build a single instance of Interceptor.
-
-
Constructor Summary
Constructors Constructor Description Interceptor.Builder()
-
Method Summary
Modifier and Type Method Description final UnitonCheck(Boolean isOverride, Function2<INTERACTION, ASSERTION, Unit> interceptor)Sets the interceptor for the checkoperation for a given interaction.final UnitonPerform(Boolean isOverride, Function2<INTERACTION, ACTION, Unit> interceptor)Sets the interceptor for the performoperation for a given interaction.final UnitonAll(Boolean isOverride, Function1<INTERACTION, Unit> interceptor)Sets the interceptor for the checkandperformoperations for a given interaction.-
-
Method Detail
-
onCheck
final Unit onCheck(Boolean isOverride, Function2<INTERACTION, ASSERTION, Unit> interceptor)
Sets the interceptor for the
checkoperation for a given interaction. If overridden, breaks the call chain of operation and transfers the responsibility to invoke the Espresso on the developer.- Parameters:
isOverride- iftrue- breaks the call chain, false otherwiseinterceptor- lambda with intercepting logic
-
onPerform
final Unit onPerform(Boolean isOverride, Function2<INTERACTION, ACTION, Unit> interceptor)
Sets the interceptor for the
performoperation for a given interaction. If overridden, breaks the call chain of operation and transfers the responsibility to invoke the Espresso on the developer.- Parameters:
isOverride- iftrue- breaks the call chain, false otherwiseinterceptor- lambda with intercepting logic
-
onAll
final Unit onAll(Boolean isOverride, Function1<INTERACTION, Unit> interceptor)
Sets the interceptor for the
checkandperformoperations for a given interaction. If overridden, breaks the call chain of operation and transfers the responsibility to invoke the Espresso on the developer.This interceptor is prioritized and is being invoked first for both operations.
- Parameters:
isOverride- iftrue- breaks the call chain, false otherwiseinterceptor- lambda with intercepting logic
-
-
-
-