Record Class BiometricResult
java.lang.Object
java.lang.Record
com.iizix.gyro.BiometricResult
- Record Components:
request- The request IDauthenticatereturned, 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.NONEfor 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 (seeBiometricError), 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
Nested Class Summary
Nested ClassesConstructor Summary
ConstructorsConstructorDescriptionBiometricResult(int request, boolean success, BiometricResult.Method method, BiometricError error, int code, String message, boolean emulated) Creates the result.Method Summary
Modifier and TypeMethodDescriptionintcode()Returns the value of thecoderecord component.booleanemulated()Returns the value of theemulatedrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.static BiometricResultfailure(int request, BiometricError error) Creates a failure of the server's own: the error's own code, no message.static BiometricResultfailure(int request, BiometricError error, int code, String message, boolean emulated) Creates a failure.final inthashCode()Returns a hash code value for this object.booleanChecks if the user ended the check rather than failing it.message()Returns the value of themessagerecord component.method()Returns the value of themethodrecord component.intrequest()Returns the value of therequestrecord component.booleansuccess()Returns the value of thesuccessrecord component.static BiometricResultsuccess(int request, BiometricResult.Method method, boolean emulated) Creates a success.toString()Gets a text for a log line:SUCCESS method=... emulated=...orFAILED error=... code=... message='...' emulated=....
Constructor Details
BiometricResult
public BiometricResult(int request, boolean success, BiometricResult.Method method, BiometricError error, int code, String message, boolean emulated) Creates the result.- Throws:
NullPointerException- Ifmethodis null.IllegalArgumentException- If a success has an error or a failure has none, or a success has the methodBiometricResult.Method.NONE.
Method Details
success
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- Iferroris null.
failure
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- Iferroris 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
hashCode
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes.request
success
method
error
code
message
emulated