protocolNamesMap static method

Map<String, String> protocolNamesMap(
  1. ModelMapping mapping
)

Generate model action protocol name map.

Implementation

static Map<String, String> protocolNamesMap(ModelMapping mapping) {
  final entries = ModelAction.values
      .map((e) => (e.name, e.protocolName(mapping)))
      .whereType<(String, String)>()
      .map((e) => MapEntry(e.$1, e.$2));

  return Map.fromEntries(entries);
}