-
public final class Interceptor<INTERACTION extends Object, ASSERTION extends Object, ACTION extends Object>Base class for intercepting the call chain from Kakao to Espresso.
Interceptors can be provided through Kakao runtime, different Screens as well as KViews.
Interceptors are stacked during the runtime for any Kakao-Espresso
checkandperformoperations. The stack ordering is following: KView interceptor -> Screen interceptors -> Kakao interceptor.Any of the interceptors in the chain can break the chain call by setting
isOverrideto true in onCheck, onPerform or onAll interception functions during the configuration. Doing this will not only prevent underlying interceptors from being invoked, but prevents Kakao from executing the operation. In that case, responsibility for actually making Espresso call lies on developer.For each operation the interceptor invocation cycle will be as follows:
// For check operation onAll?.invoke() onCheck?.invoke() // For perform operation onAll?.invoke() onPerform?.invoke()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classInterceptor.BuilderBuilder class that is used to build a single instance of Interceptor.
public final classInterceptor.ConfiguratorConfiguration class that is used for building interceptors on the Kakao runtime and Screen levels.
public final classInterceptor.Configuration
-
Field Summary
Fields Modifier and Type Field Description private final Interception<Function2<INTERACTION, ASSERTION, Unit>>onCheckprivate final Interception<Function2<INTERACTION, ACTION, Unit>>onPerformprivate final Interception<Function1<INTERACTION, Unit>>onAll
-
Constructor Summary
Constructors Constructor Description Interceptor(Interception<Function2<INTERACTION, ASSERTION, Unit>> onCheck, Interception<Function2<INTERACTION, ACTION, Unit>> onPerform, Interception<Function1<INTERACTION, Unit>> onAll)
-
Method Summary
Modifier and Type Method Description final Interception<Function2<INTERACTION, ASSERTION, Unit>>getOnCheck()final Interception<Function2<INTERACTION, ACTION, Unit>>getOnPerform()final Interception<Function1<INTERACTION, Unit>>getOnAll()-
-
Constructor Detail
-
Interceptor
Interceptor(Interception<Function2<INTERACTION, ASSERTION, Unit>> onCheck, Interception<Function2<INTERACTION, ACTION, Unit>> onPerform, Interception<Function1<INTERACTION, Unit>> onAll)
-
-
Method Detail
-
getOnCheck
final Interception<Function2<INTERACTION, ASSERTION, Unit>> getOnCheck()
-
getOnPerform
final Interception<Function2<INTERACTION, ACTION, Unit>> getOnPerform()
-
getOnAll
final Interception<Function1<INTERACTION, Unit>> getOnAll()
-
-
-
-