Package ch.nevis.mobile.sdk.api
Interface MobileAuthenticationClientInitializer
public interface MobileAuthenticationClientInitializer
The class that creates and initializes asynchronously an instance of
MobileAuthenticationClient.-
Method Summary
Modifier and TypeMethodDescriptionconfiguration(Configuration configuration) Sets the configuration of theMobileAuthenticationClient.context(android.content.Context context) Sets the Android context.voidexecute()Starts the creation of an instance of theMobileAuthenticationClient.Returns a newMobileAuthenticationClientInitializer.onError(Consumer<InitializationError> errorConsumer) The object invoked when an error occurs after invokingexecute().onSuccess(Consumer<MobileAuthenticationClient> mobileAuthenticationClientConsumer) The method invoked when theMobileAuthenticationClientcould be successfully built after invokingexecute().
-
Method Details
-
context
Sets the Android context.Providing the context is required.
- Parameters:
context- the Android context.- Returns:
- an initializer
-
configuration
Sets the configuration of theMobileAuthenticationClient.Providing the configuration is required.
- Parameters:
configuration- theMobileAuthenticationClientconfiguration.- Returns:
- an initializer
-
onError
@NonNull MobileAuthenticationClientInitializer onError(@NonNull Consumer<InitializationError> errorConsumer) The object invoked when an error occurs after invokingexecute(). This object will be invoked in the main/UI thread.Providing the object handling the error is required.
- Parameters:
errorConsumer- the object handling the error- Returns:
- an initializer
-
onSuccess
@NonNull MobileAuthenticationClientInitializer onSuccess(@NonNull Consumer<MobileAuthenticationClient> mobileAuthenticationClientConsumer) The method invoked when theMobileAuthenticationClientcould be successfully built after invokingexecute(). This object will be invoked in the main/UI thread.Providing the object handling the
MobileAuthenticationClientis required.- Parameters:
mobileAuthenticationClientConsumer- the object handling theMobileAuthenticationClient- Returns:
- an initializer
-
execute
void execute()Starts the creation of an instance of theMobileAuthenticationClient. If an error occurs, it is provided throughonError(Consumer), if theMobileAuthenticationClientcan be successfully built and initialized, it is provided throughonSuccess(Consumer). -
initializer
Returns a newMobileAuthenticationClientInitializer.- Returns:
- a new
MobileAuthenticationClientInitializer
-