fromJson static method

AttributeValueEntity fromJson(
  1. dynamic value
)

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

Implementation

// ignore: prefer_constructors_over_static_methods
static AttributeValueEntity fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return AttributeValueEntity(
      definitionId: mapValueOfType<int>(json, r'DefinitionId'),
      assetModelId: mapValueOfType<int>(json, r'AssetModelId'),
      entityId: mapValueOfType<int>(json, r'EntityId'),
      value: ValueContainer.fromJson(json[r'Value']),
      dateCreated: mapDateTime(json, r'DateCreated', ''),
      dateModified: mapDateTime(json, r'DateModified', ''),
      entity: EntityBase.fromJson(json[r'Entity']),
    );
  }
  return null;
}