OkfFindingId.parse constructor

OkfFindingId.parse(
  1. String value
)

Parses and validates a namespaced identifier.

Implementation

factory OkfFindingId.parse(String value) {
  final match = _grammar.firstMatch(value);
  if (match == null) {
    throw FormatException(
      'Finding IDs must use the <namespace>/<code> grammar, each segment '
      'lowercase kebab-case',
      value,
    );
  }
  return OkfFindingId._(match[1]!, match[2]!);
}