AsyncFormValidator
This class is a simple FormValidator wrapper for usage from Java, providing methods returning completable futures instead of Kotlin flows.
Use this class to validate form values. Form values are of type T and represent the content of a form with the provided form schema.
External validations may be provided to further validate the form against validations not present in the schema.
Once instantiated with a given form schema, the validator can be used to validate values according to all validations of said schema, as well as the validator's external validations.
Optionally provide an Executor to specify the threading model for running validations. By default, the kotlinx.coroutines Default thread pool is used. Pass Runnable::run as the executor to instead run validations in the calling thread.
Constructors
Functions
Returns a future that completes with whether all parts of the form value formValue are valid according to the validator's schema.
Validates all parts of the form value formValue against the validator's schema. Returns a future that completes with a list of found validation issues.
Validates the parts of the form value formValue matching path against the validator's schema. Returns a future that completes with a list of found validation issues.