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