then

infix fun then(block: ValidationRuleBuilder<S>.() -> Unit)

Chains a set of rules to the transformation function.

Usage:

rules<String> {
notBlank { "must be not blank" }
cast { it.length } then {
minimum(3) { "must be at least 3 characters" }
maximum(20) { "must be at most 20 characters" }
}
}

Parameters

block

The block to build the set of rules.