Interface PinChange
- All Superinterfaces:
Operation
The object that can be used to change the PIN.
Example:
private void changePin(Operations operations, String username) { operations.pinChange() .username(username) .pinChanger((context, consumer) -> { if (context.lastRecoverableError().isPresent()) { // Display error. } char[] oldPin = askUserForOldPin(); char[] newPin = askUserForNewPin(); if (oldPin != null && newPin != null) { consumer.pins(oldPin, newPin); } else { consumer.cancel(); } }) .onError(pinError -> { // handle error }) .onSuccess(() -> { // handle success }) .execute(); }
-
Method Summary
Modifier and TypeMethodDescriptiononError
(Consumer<PinChangeError> errorConsumer) The method invoked when the PIN could not be changed: the PIN was not enrolled, the PIN is locked or the operation was canceled.Specifies the object that will be invoked if the PIN was successfully modified.pinChanger
(PinChanger pinChanger) Specifies the object that will be informed of the potential recoverable errors and is responsible for obtaining the PIN from the end-user.The username whose PIN must be changed.
-
Method Details
-
username
The username whose PIN must be changed.Providing the username is required.
- Parameters:
username
- the username- Returns:
- a
PinChange
-
pinChanger
Specifies the object that will be informed of the potential recoverable errors and is responsible for obtaining the PIN from the end-user.Providing the PIN changer is required.
- Parameters:
pinChanger
- thePinChanger
.- Returns:
- a
PinChange
-
onError
The method invoked when the PIN could not be changed: the PIN was not enrolled, the PIN is locked or the operation was canceled.The specified object will receive an
PinChangeError
. This object will be invoked in the main/UI thread.Providing the object handling the error is required.
- Parameters:
errorConsumer
- the consumer of anPinChangeError
- Returns:
- a
PinChange
-
onSuccess
Specifies the object that will be invoked if the PIN was successfully modified. This object will be invoked in the main/UI thread.Providing the object handling the success is required.
- Parameters:
onSuccess
- the object invoked on successful PIN modification- Returns:
- a
PinChange
-