studentLoanStatusTypeFromJson function

StudentLoanStatusType studentLoanStatusTypeFromJson(
  1. Object? studentLoanStatusType, [
  2. StudentLoanStatusType? defaultValue
])

Implementation

enums.StudentLoanStatusType studentLoanStatusTypeFromJson(
  Object? studentLoanStatusType, [
  enums.StudentLoanStatusType? defaultValue,
]) {
  if (studentLoanStatusType is String) {
    return enums.$StudentLoanStatusTypeMap.entries
        .firstWhere(
            (element) =>
                element.value.toLowerCase() ==
                studentLoanStatusType.toLowerCase(),
            orElse: () => const MapEntry(
                enums.StudentLoanStatusType.swaggerGeneratedUnknown, ''))
        .key;
  }

  final parsedResult = defaultValue == null
      ? null
      : enums.$StudentLoanStatusTypeMap.entries
          .firstWhereOrNull((element) => element.value == defaultValue)
          ?.key;

  return parsedResult ??
      defaultValue ??
      enums.StudentLoanStatusType.swaggerGeneratedUnknown;
}