DataPoint class

A data point storing meta-information and the data.

CARP DataPoint definition accepted by the server, version 1.2 (example):

{
 "id": 224038,                                   # set by the server, not used in upload
 "created_by_user_id": 1,                        # set by the server, not used in upload
 "study_id": "c9d341ae",                         # set by the server, not used in upload
 "carp_header": {
  "study_id": "01cf04a7",                        # required - should be the study_deployment_id
  "device_role_name": "phone",                   # optional
  "trigger_id": "1",                             # optional
  "user_id": "1e828ea0-78f7-11eb-a4c1",          # required - use a UUID and avoid usernames like 'user@dtu.dk'
  "upload_time": "2021-02-27T12:27:14.933672Z",  # set by the server, not used in upload
  "start_time": "2021-02-27T12:27:12.902614Z",   # optional
  "end_time": "2021-02-27T12:27:14.933672Z",     # optional
  "data_format": {                               # required
   "namespace": "dk.cachet.carp",
   "name": "light"
  }
 },
 "carp_body": {                                  # required
  "id": "1e828ea0-78f7-11eb-a4c1-8518ece21966",
  "timestamp": "2021-02-27T12:27:12.902614Z"
  "max_lux": 12,
  "mean_lux": 23,
  "min_lux": 0.3,
  "std_lux": 0.4,
 }
}
Annotations
  • @JsonSerializable(fieldRename: FieldRename.snake, includeIfNull: false)

Constructors

DataPoint(DataPointHeader carpHeader, [Data? data])
Create a new DataPoint.
DataPoint.fromData(Data data)
Create a DataPoint from a Data object.
factory
DataPoint.fromJson(Map<String, dynamic> json)
Create a DataPoint from a JSON map.
factory

Properties

carpBody Map<String, dynamic>?
The CARP data point body. Can be any JSON payload.
getter/setter pair
carpHeader DataPointHeader
The data point header.
getter/setter pair
createdByUserId int?
The unique id of the user who created / uploaded this data point. null if this data point is not yet stored.
getter/setter pair
data ↔ Data?
The CARP data point body. Can be any payload modelled as a Data.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id int?
A unique, server-side generated ID for this data point. null if this data point is not yet stored.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
studyId String?
The unique study deployment id that this data point belongs to / is uploaded as part of. Set by the server. null if this data point is not yet stored.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serialize this DataPoint as a JSON map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited