fromJson static method

ModelMappingReport fromJson(
  1. dynamic value
)

Returns a new ModelMappingReport instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static ModelMappingReport fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return ModelMappingReport(
      sourceModelId: mapValueOfType<int>(json, r'SourceModelId'),
      targetModelId: mapValueOfType<int>(json, r'TargetModelId'),
      mappingId: mapValueOfType<String>(json, r'MappingId'),
      sourceEntityCount: mapValueOfType<int>(json, r'SourceEntityCount'),
      targetEntityCount: mapValueOfType<int>(json, r'TargetEntityCount'),
      mappedEntities: EntityMappingInfo.listFromJson(json[r'MappedEntities']),
      candidateMatches: EntityMatchInfo.listFromJson(json[r'CandidateMatches']),
      foundEntities: EntityBase.listFromJson(json[r'FoundEntities']),
      lostEntities: EntityBase.listFromJson(json[r'LostEntities']),
      messages: MappingMessageInfo.listFromJson(json[r'Messages']),
      mappedCount: mapValueOfType<int>(json, r'MappedCount'),
      partialMatchCount: mapValueOfType<int>(json, r'PartialMatchCount'),
      foundCount: mapValueOfType<int>(json, r'FoundCount'),
      lostCount: mapValueOfType<int>(json, r'LostCount'),
      mappingProperties: MappingProperties.fromJson(json[r'MappingProperties']),
    );
  }
  return null;
}