ValidationRuleSet

A type alias for a set of validation rules.

A validation rule set represents a collection of validation rules that can be applied to a value. All rules in the set are typically evaluated, and any failures are collected into a combined validation result.

Usage:

val stringRules: ValidationRuleSet<String> = setOf(
{ value -> if (value.isNotBlank()) ValidationResult.Valid else ValidationResult.Invalid("Required") },
{ value -> if (value.length >= 3) ValidationResult.Valid else ValidationResult.Invalid("Too short") }
)

Parameters

V

The type of the value to be validated.