programNameSensitivityFromJson function
ProgramNameSensitivity
programNameSensitivityFromJson(
- Object? programNameSensitivity, [
- ProgramNameSensitivity? defaultValue
Implementation
enums.ProgramNameSensitivity programNameSensitivityFromJson(
Object? programNameSensitivity, [
enums.ProgramNameSensitivity? defaultValue,
]) {
if (programNameSensitivity is String) {
return enums.$ProgramNameSensitivityMap.entries
.firstWhere(
(element) =>
element.value.toLowerCase() ==
programNameSensitivity.toLowerCase(),
orElse: () => const MapEntry(
enums.ProgramNameSensitivity.swaggerGeneratedUnknown, ''))
.key;
}
final parsedResult = defaultValue == null
? null
: enums.$ProgramNameSensitivityMap.entries
.firstWhereOrNull((element) => element.value == defaultValue)
?.key;
return parsedResult ??
defaultValue ??
enums.ProgramNameSensitivity.swaggerGeneratedUnknown;
}