api / koma.util.validation / validate
validate
fun validate(fn:ValidationContext.() ->Unit):Unit
Execute the given rules within a ValidationContext, letting you validate multiple matrices at once with interrelated dimensions, and return a list of matrices that match your validation rules.
funMatrix<Double>.validate(fn:ValidationContext.() ->Unit):Unit
Use the given fn to validate a matrix. Return either the matrix itself or a copy that has been transformed to match the validation rules.
In general it is preferable to use the other verison of this function that lets you specify a name. All matrices that are validated with this method will appear in the error message with the name "matrix"
Parameters
fn - Validation rules for the matrix.
See Also
Returns Either a reference to the input matrix itself, or a transformed version. The return value is guaranteed to pass the validation rules.
funMatrix<Double>.validate(name:String, fn:ValidationContext.() ->Unit):Unit
Use the given fn to validate a matrix with the given name. Return either the matrix itself or a copy that has been transformed to match the validation rules.
Parameters
name - The name of the matrix (used in displayed errors)
fn - Validation rules for the matrix.