SamplePoint.fromMap constructor

SamplePoint.fromMap(
  1. Map map
)

Implementation

factory SamplePoint.fromMap(Map<dynamic, dynamic> map) {
  SamplePoint instance = SamplePoint(
    id: map['id'],
    startTime: map['startTime'] != null
        ? DateTime.fromMillisecondsSinceEpoch(map['startTime'])
        : null,
    endTime: map['endTime'] != null
        ? DateTime.fromMillisecondsSinceEpoch(map['endTime'])
        : null,
    samplingTime: map['samplingTime'] != null
        ? DateTime.fromMillisecondsSinceEpoch(map['samplingTime'])
        : null,
    dataCollector: map['dataCollector'] != null
        ? DataCollector.fromMap(map['dataCollector'])
        : null,
    dataType:
        map['dataType'] != null ? DataType.fromMap(map['dataType']) : null,
  );
  if (map['insertionTime'] != null) {
    instance._insertionTime =
        DateTime.fromMillisecondsSinceEpoch(map['insertionTime']);
  }
  if (map['fieldValues'] != null) {
    instance._fieldValues = Map<String, dynamic>.from(map['fieldValues']);
  }
  if (map['dataTypeId'] != null) {
    instance._dataTypeId = map['dataTypeId'];
  }
  return instance;
}