Interface PinChange

All Superinterfaces:
Operation

public interface PinChange extends 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 Type
    Method
    Description
    The method invoked when the PIN could not be changed: the PIN was not enrolled, the PIN is locked or the operation was canceled.
    onSuccess(Runnable onSuccess)
    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.
    username(String username)
    The username whose PIN must be changed.

    Methods inherited from interface ch.nevis.mobile.sdk.api.operation.Operation

    execute
  • Method Details

    • username

      PinChange username(String username)
      The username whose PIN must be changed.

      Providing the username is required.

      Parameters:
      username - the username
      Returns:
      a PinChange
    • pinChanger

      PinChange 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.

      Providing the PIN changer is required.

      Parameters:
      pinChanger - the PinChanger.
      Returns:
      a PinChange
    • onError

      PinChange onError(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.

      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 an PinChangeError
      Returns:
      a PinChange
    • onSuccess

      PinChange onSuccess(Runnable 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