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