element

Creates a validation rule chain for applying rules to each element of the array.

This function allows you to validate each individual element within an array using the all function internally. It's useful when you need to ensure that every element in the array meets certain criteria.

Usage:

rules<Array<String>> {
notEmpty { "array must not be empty" }
element {
notBlank { "must be not blank" }
minLength(3) { "must be at least 3 characters" }
}
}

Parameters

V

The type of the elements in the array.

block

A lambda that builds the validation rules using ValidationRuleBuilder.


Creates a validation rule chain for applying rules to each element of the collection.

This function allows you to validate each individual element within a collection using the all function internally. It's useful when you need to ensure that every element in the collection meets certain criteria.

Usage:

rules<Collection<String>> {
notEmpty { "collection must not be empty" }
element {
notBlank { "must be not blank" }
minLength(3) { "must be at least 3 characters" }
}
}

Parameters

V

The type of the elements in the collection.

block

A lambda that builds the validation rules using ValidationRuleBuilder.