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 TypeMethodDescriptionapplication
(android.app.Application application) Sets the Android application.configuration
(Configuration configuration) Sets the configuration of theMobileAuthenticationClient
.void
execute()
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 theMobileAuthenticationClient
could be successfully built after invokingexecute()
.
-
Method Details
-
application
Sets the Android application.- Parameters:
application
- the Android application.- Returns:
- an initializer
-
configuration
Sets the configuration of theMobileAuthenticationClient
.Providing the configuration is required.
- Parameters:
configuration
- theMobileAuthenticationClient
configuration.- Returns:
- an initializer
-
onError
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
MobileAuthenticationClientInitializer onSuccess(Consumer<MobileAuthenticationClient> mobileAuthenticationClientConsumer) The method invoked when theMobileAuthenticationClient
could be successfully built after invokingexecute()
. This object will be invoked in the main/UI thread.Providing the object handling the
MobileAuthenticationClient
is 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 theMobileAuthenticationClient
can be successfully built and initialized, it is provided throughonSuccess(Consumer)
. -
initializer
Returns a newMobileAuthenticationClientInitializer
.- Returns:
- a new
MobileAuthenticationClientInitializer
-