JavaSettings.fromJson constructor

JavaSettings.fromJson(
  1. Object? j
)

Implementation

factory JavaSettings.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return JavaSettings(
    libraryPackage: switch (json['libraryPackage']) {
      null => '',
      Object $1 => decodeString($1),
    },
    serviceClassNames: switch (json['serviceClassNames']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException(
        '"serviceClassNames" is not an object',
      ),
    },
    common: switch (json['common']) {
      null => null,
      Object $1 => CommonLanguageSettings.fromJson($1),
    },
  );
}