doValidate method

  1. @override
ValidationResult doValidate()
override

Implementation

@override
ValidationResult doValidate() {
  if (type == KeyType.invalidKey) {
    return ValidationResult('$key is not a valid key');
  }

  bool match = RegexUtil.matchAll(regex, key);
  if (!match) {
    return ValidationResult('$key does not adhere to the regex $regex');
  }
  return ValidationResult.noFailure();
}