FileData
A Data object holding a link to a file, e.g. an audio recording or image.
The file itself is stored on the phone at path. A data manager can upload the file in addition to this metadata, if upload is true.
- Inheritance
-
- Object
- Serializable
- Data
- FileData
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
FileData.fromJson
FileData
Creates a new FileData for filename and whether it is to be uploaded.
Properties
filename
The name of the attached file.
fromJsonFunction
The function which can convert a JSON string to an object of this type.
metadata
Metadata for this file as a map of string key-value pairs.
path
The local path to the attached file on the phone where it is sampled. This is used by e.g. a data manager to get and manage the file on the phone.
upload
Whether to upload the file too, or only this metadata. Default is true.
Methods
equivalentTo
Is this data equivalent to other?
This is a custom 'soft' equal (==) operator used to compare two data objects. Used in triggering when some data is collected. Override in subclasses to provide custom equivalence checking.
toJson
Return a JSON encoding of this object.