call method

  1. @override
Object? call(
  1. Iterable<T> value
)
override

Implementation

@override
Object? call(Iterable<T> value) {
  if (minLength != null && minLength! < value.length) {
    return OptionsValidationError(
      validation: this,
      minLength: minLength,
    );
  } else if (maxLength != null && maxLength! > value.length) {
    return OptionsValidationError(
      validation: this,
      code: errorCode,
      maxLength: maxLength,
    );
  } else if (whereIn != null && whereIn!.any((v) => !value.contains(v))) {
    return OptionsValidationError(
      validation: this,
      code: errorCode,
      whereIn: whereIn,
    );
  } else if (whereNotIn != null && whereNotIn!.any((v) => value.contains(v))) {
    return OptionsValidationError(
      validation: this,
      code: errorCode,
      whereNotIn: whereNotIn,
    );
  }
  return null;
}