fromJson static method

EntityMappingInfo fromJson(
  1. dynamic value
)

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

Implementation

// ignore: prefer_constructors_over_static_methods
static EntityMappingInfo fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return EntityMappingInfo(
      mappingId: mapValueOfType<String>(json, r'MappingId'),
      sourceAssetModelId: mapValueOfType<int>(json, r'SourceAssetModelId'),
      sourceEntityId: mapValueOfType<int>(json, r'SourceEntityId'),
      targetAssetModelId: mapValueOfType<int>(json, r'TargetAssetModelId'),
      targetEntityId: mapValueOfType<int>(json, r'TargetEntityId'),
      sourceEntity: EntityBase.fromJson(json[r'SourceEntity']),
      targetEntity: EntityBase.fromJson(json[r'TargetEntity']),
      matchType: mapValueOfType<String>(json, r'MatchType'),
      percentConfidence: mapValueOfType<int>(json, r'PercentConfidence'),
      mapping: ModelMapping.fromJson(json[r'Mapping']),
    );
  }
  return null;
}