-
- All Implemented Interfaces:
-
java.io.Serializable
public class Record implements Serializable
Base class for all objects that represent health records.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
Record.RecordType
Each record corresponds to a different Validic Connect endpoint.
public class
Record.ExtrasKey
public class
Record.TimestampComparator
Comparator class for timestamp comparison
-
Field Summary
Fields Modifier and Type Field Description private final String
queueId
private final Map<String, Object>
extras
private Date
timestamp
private String
utcOffset
private String
source
private String
sourceName
private String
originalSource
private String
intermediarySource
private String
sourcePeripheral
private Date
lastUpdated
private String
recordID
private Boolean
validated
private String
activityID
private Array<Media>
media
private Record.RecordType
recordType
private Peripheral
peripheral
-
Constructor Summary
Constructors Constructor Description Record()
Base class for all objects that represent health records. Record(Peripheral peripheral)
Base class for all objects that represent health records initialized just as the default constructor, while populating the Peripheral member.
-
Method Summary
Modifier and Type Method Description String
getQueueId()
Map<String, Object>
getExtras()
Expanded data of the endpoint Date
getTimestamp()
Timestamp for the measurement void
setTimestamp(Date timestamp)
Timestamp for the measurement String
getUtcOffset()
Timezone information for the measurement set formatted as +/-HH:MM void
setUtcOffset(String utcOffset)
Timezone information for the measurement set formatted as +/-HH:MM String
getSource()
The short name of the application that recorded the activity void
setSource(String source)
The short name of the application that recorded the activity String
getSourceName()
The display name of the application that recorded the activity void
setSourceName(String sourceName)
The display name of the application that recorded the activity String
getOriginalSource()
Returns the name of the Peripheral manufacturer; for records sourced from Samsung Health, this will be the name of the application that originally wrote the data to Samsung Health. void
setOriginalSource(String originalSource)
Sets the name of the Peripheral manufacturer; for records sourced from Samsung Health, this will be the name of the application that originally wrote the data to Samsung Health. String
getIntermediarySource()
Returns the name of the library technology used to create the record (eg "ValidicMobile Bluetooth", "ValidicMobile Apple Health") void
setIntermediarySource(String intermediarySource)
Sets the name of the library technology used to create the record (eg "ValidicMobile Bluetooth", "ValidicMobile Apple Health") String
getSourcePeripheral()
Returns the model number of the peripheral, for records sourced from Samsung Health this will be the package name of the application that originally wrote the data to Samsung Health. void
setSourcePeripheral(String sourcePeripheral)
Sets the model number of the peripheral, for records sourced from Samsung Health this will be the package name of the application that originally wrote the data to Samsung Health. Date
getLastUpdated()
Date and time when the measurement set was last updated void
setLastUpdated(Date lastUpdated)
Date and time when the measurement set was last updated String
getRecordID()
Unique identifier of the data void
setRecordID(String recordID)
Unique identifier of the data Boolean
getValidated()
Returns false if the user has manually altered the record. void
setValidated(Boolean validated)
Set to false if the user has manually altered the record. String
getActivityID()
Activity record id void
setActivityID(String activityID)
Activity record id Array<Media>
getMedia()
Associated media void
setMedia(Array<Media> media)
Record.RecordType
getRecordType()
Which of the various records is being instantiated. void
setRecordType(Record.RecordType recordType)
Which of the various records is being instantiated. Peripheral
getPeripheral()
Peripheral which produced the reading void
setPeripheral(Peripheral peripheral)
static Record
newRecordFromPeripheral(Peripheral peripheral)
static Record
newRecordWithType(Peripheral.PeripheralType type)
static Map<Record.RecordType, Integer>
createSummary(Collection<Record> records)
String
getIdentifier()
void
setTimeStampToMidnight(Date timestamp, TimeZone timeZone)
String
getComment()
Retrieve a comment for this record void
setComment(String comment)
Store a comment associated with a record <T> T
getExtra(String key)
A convenience function for retrieving any type from extras storage. void
setHashedActivityId(String rawValue)
Hashes and Base64 encodes the passed value before setting it. static String
getHashedString(String rawValue)
boolean
isSHealthRecord()
Returns whether this record was captured from Samsung S Health. -
-
Constructor Detail
-
Record
Record()
Base class for all objects that represent health records.
-
Record
Record(Peripheral peripheral)
Base class for all objects that represent health records initialized just as the default constructor, while populating the Peripheral member.
-
-
Method Detail
-
getQueueId
@NonNull() String getQueueId()
-
getTimestamp
Date getTimestamp()
Timestamp for the measurement
-
setTimestamp
void setTimestamp(Date timestamp)
Timestamp for the measurement
-
getUtcOffset
String getUtcOffset()
Timezone information for the measurement set formatted as +/-HH:MM
-
setUtcOffset
void setUtcOffset(String utcOffset)
Timezone information for the measurement set formatted as +/-HH:MM
-
setSource
void setSource(String source)
The short name of the application that recorded the activity
-
getSourceName
String getSourceName()
The display name of the application that recorded the activity
-
setSourceName
void setSourceName(String sourceName)
The display name of the application that recorded the activity
-
getOriginalSource
String getOriginalSource()
Returns the name of the Peripheral manufacturer; for records sourced from Samsung Health, this will be the name of the application that originally wrote the data to Samsung Health.
-
setOriginalSource
void setOriginalSource(String originalSource)
Sets the name of the Peripheral manufacturer; for records sourced from Samsung Health, this will be the name of the application that originally wrote the data to Samsung Health.
-
getIntermediarySource
String getIntermediarySource()
Returns the name of the library technology used to create the record (eg "ValidicMobile Bluetooth", "ValidicMobile Apple Health")
-
setIntermediarySource
void setIntermediarySource(String intermediarySource)
Sets the name of the library technology used to create the record (eg "ValidicMobile Bluetooth", "ValidicMobile Apple Health")
-
getSourcePeripheral
String getSourcePeripheral()
Returns the model number of the peripheral, for records sourced from Samsung Health this will be the package name of the application that originally wrote the data to Samsung Health.
-
setSourcePeripheral
void setSourcePeripheral(String sourcePeripheral)
Sets the model number of the peripheral, for records sourced from Samsung Health this will be the package name of the application that originally wrote the data to Samsung Health.
-
getLastUpdated
Date getLastUpdated()
Date and time when the measurement set was last updated
-
setLastUpdated
void setLastUpdated(Date lastUpdated)
Date and time when the measurement set was last updated
-
getRecordID
String getRecordID()
Unique identifier of the data
-
setRecordID
void setRecordID(String recordID)
Unique identifier of the data
-
getValidated
Boolean getValidated()
Returns false if the user has manually altered the record.
-
setValidated
void setValidated(Boolean validated)
Set to false if the user has manually altered the record.
-
getActivityID
@Nullable() String getActivityID()
Activity record id
-
setActivityID
void setActivityID(String activityID)
Activity record id
-
getRecordType
Record.RecordType getRecordType()
Which of the various records is being instantiated. RecordType
-
setRecordType
void setRecordType(Record.RecordType recordType)
Which of the various records is being instantiated. RecordType
-
getPeripheral
Peripheral getPeripheral()
Peripheral which produced the reading
-
setPeripheral
void setPeripheral(Peripheral peripheral)
-
newRecordFromPeripheral
static Record newRecordFromPeripheral(Peripheral peripheral)
-
newRecordWithType
static Record newRecordWithType(Peripheral.PeripheralType type)
-
createSummary
static Map<Record.RecordType, Integer> createSummary(Collection<Record> records)
-
getIdentifier
@NonNull() String getIdentifier()
-
setTimeStampToMidnight
void setTimeStampToMidnight(Date timestamp, TimeZone timeZone)
-
getComment
String getComment()
Retrieve a comment for this record
-
setComment
void setComment(String comment)
Store a comment associated with a record
-
getExtra
<T> T getExtra(String key)
A convenience function for retrieving any type from extras storage.
-
setHashedActivityId
void setHashedActivityId(String rawValue)
Hashes and Base64 encodes the passed value before setting it.
- Parameters:
rawValue
- The value to be hashed, encoded, and saved as the activityId.
-
getHashedString
static String getHashedString(String rawValue)
-
isSHealthRecord
boolean isSHealthRecord()
Returns whether this record was captured from Samsung S Health.
-
-
-
-