fromJson static method

ColumnDefinition fromJson(
  1. dynamic value
)

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

Implementation

// ignore: prefer_constructors_over_static_methods
static ColumnDefinition fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return ColumnDefinition(
      id: mapValueOfType<int>(json, r'Id'),
      name: mapValueOfType<String>(json, r'Name'),
      imported: mapValueOfType<bool>(json, r'Imported'),
      semanticType: mapValueOfType<String>(json, r'SemanticType'),
      unit: mapValueOfType<String>(json, r'Unit'),
      dataType: ColumnDefinitionDataTypeEnum.fromJson(json[r'DataType']),
    );
  }
  return null;
}