Builder
class Builder
kotlin.Any | |
↳ | android.health.connect.datatypes.HeartRateRecord.Builder |
Builder class for HeartRateRecord
Summary
Public constructors | |
---|---|
Builder(metadata: Metadata, startTime: Instant, endTime: Instant, heartRateSamples: MutableList<HeartRateRecord.HeartRateSample!>) |
Public methods | |
---|---|
HeartRateRecord |
build() |
HeartRateRecord.Builder |
Sets the start zone offset of this record to system default. |
HeartRateRecord.Builder |
Sets the start zone offset of this record to system default. |
HeartRateRecord.Builder |
setEndZoneOffset(endZoneOffset: ZoneOffset) Sets the zone offset of the user when the activity ended. |
HeartRateRecord.Builder |
setStartZoneOffset(startZoneOffset: ZoneOffset) Sets the zone offset of the user when the activity started. |
Public constructors
Builder
Builder(
metadata: Metadata,
startTime: Instant,
endTime: Instant,
heartRateSamples: MutableList<HeartRateRecord.HeartRateSample!>)
Parameters | |
---|---|
metadata |
Metadata: Metadata to be associated with the record. See Metadata . This value cannot be null . |
startTime |
Instant: Start time of this activity This value cannot be null . |
endTime |
Instant: End time of this activity This value cannot be null . |
heartRateSamples |
MutableList<HeartRateRecord.HeartRateSample!>: Samples of recorded heart rate This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if heartRateSamples is empty |
Public methods
build
fun build(): HeartRateRecord
Return | |
---|---|
HeartRateRecord |
Object of HeartRateRecord This value cannot be null . |
clearEndZoneOffset
fun clearEndZoneOffset(): HeartRateRecord.Builder
Sets the start zone offset of this record to system default.
Return | |
---|---|
HeartRateRecord.Builder |
This value cannot be null . |
clearStartZoneOffset
fun clearStartZoneOffset(): HeartRateRecord.Builder
Sets the start zone offset of this record to system default.
Return | |
---|---|
HeartRateRecord.Builder |
This value cannot be null . |
setEndZoneOffset
fun setEndZoneOffset(endZoneOffset: ZoneOffset): HeartRateRecord.Builder
Sets the zone offset of the user when the activity ended. By default, the end zone offset is set the current zone offset.
Parameters | |
---|---|
endZoneOffset |
ZoneOffset: This value cannot be null . |
Return | |
---|---|
HeartRateRecord.Builder |
This value cannot be null . |
setStartZoneOffset
fun setStartZoneOffset(startZoneOffset: ZoneOffset): HeartRateRecord.Builder
Sets the zone offset of the user when the activity started. By default, the starting zone offset is set the current zone offset.
Parameters | |
---|---|
startZoneOffset |
ZoneOffset: This value cannot be null . |
Return | |
---|---|
HeartRateRecord.Builder |
This value cannot be null . |