Record Class BiometricResult

java.lang.Object
java.lang.Record
com.iizix.gyro.BiometricResult
Record Components:
request - The request ID authenticate returned, 0 for a result answered without a request (an error before anything was sent).
success - true when the user passed the check.
method - How the user passed, BiometricResult.Method.NONE for a failure.
error - Why the check failed, null for a success.
code - The code the client answered: the plugin's or the platform's for a failure (see BiometricError), 0 for a success or an error of the server's own.
message - The message the client answered with an error, or null.
emulated - true when the answer came from iiziRun Developer's biometric emulation, a success only when the prompt allowed it on a development server.

public record BiometricResult(int request, boolean success, BiometricResult.Method method, BiometricError error, int code, String message, boolean emulated) extends Record
The outcome of a biometric check of IBiometricAuthentication.authenticate(BiometricPrompt, Consumer) (CC-IIZIRUN-BIOMETRIC-API): a success, with how the user passed where the platform tells it, or an error with the plugin's or IIZI's code.

A success is the client's own statement, a user-presence check on a device the server cannot inspect: see IBiometricAuthentication.

Author:
Christopher Mindus
  • Constructor Details

  • Method Details

    • success

      public static BiometricResult success(int request, BiometricResult.Method method, boolean emulated)
      Creates a success.
      Parameters:
      request - The request ID.
      method - How the user passed.
      emulated - true for an emulated answer the prompt allowed.
      Returns:
      The result.
    • failure

      public static BiometricResult failure(int request, BiometricError error, int code, String message, boolean emulated)
      Creates a failure.
      Parameters:
      request - The request ID, 0 when nothing was sent.
      error - The error.
      code - The code the client answered, or the error's own code.
      message - The message the client answered, or null.
      emulated - true for an emulated answer.
      Returns:
      The result.
      Throws:
      NullPointerException - If error is null.
    • failure

      public static BiometricResult failure(int request, BiometricError error)
      Creates a failure of the server's own: the error's own code, no message.
      Parameters:
      request - The request ID, 0 when nothing was sent.
      error - The error.
      Returns:
      The result.
      Throws:
      NullPointerException - If error is null.
    • isDismissed

      public boolean isDismissed()
      Checks if the user ended the check rather than failing it.
      Returns:
      true when the error is a dismissal (BiometricError.isDismissed()).
    • toString

      public String toString()
      Gets a text for a log line: SUCCESS method=... emulated=... or FAILED error=... code=... message='...' emulated=....
      Specified by:
      toString in class Record
      Returns:
      The text.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • request

      public int request()
      Returns the value of the request record component.
      Returns:
      the value of the request record component
    • success

      public boolean success()
      Returns the value of the success record component.
      Returns:
      the value of the success record component
    • method

      public BiometricResult.Method method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • error

      public BiometricError error()
      Returns the value of the error record component.
      Returns:
      the value of the error record component
    • code

      public int code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • emulated

      public boolean emulated()
      Returns the value of the emulated record component.
      Returns:
      the value of the emulated record component