validate method
Validates an object, returning a merged list of validation result.
Implementation
ValidationResult validate(E object, {bool ignorePassedMessages = true}) {
final List<ValidationResult> results = <ValidationResult>[];
for (final AbstractRuleBuilder<E> ruleBuilder in ruleBuilders) {
final dynamic expressedValue = ruleBuilder.expression?.call(object);
for (final ValidationResult Function(dynamic) rule in ruleBuilder.rules) {
final ValidationResult result = rule(expressedValue);
results.add(result);
}
}
return ValidationResult.merge(results, ignorePassedMessages);
}