HeartRateRecord.Builder
public
static
final
class
HeartRateRecord.Builder
extends Object
| java.lang.Object | |
| ↳ | android.health.connect.datatypes.HeartRateRecord.Builder |
Builder class for HeartRateRecord
See also:
Summary
Public constructors | |
|---|---|
Builder(Metadata metadata, Instant startTime, Instant endTime, List<HeartRateRecord.HeartRateSample> heartRateSamples)
Make a builder for |
|
Public methods | |
|---|---|
HeartRateRecord
|
build()
|
HeartRateRecord.Builder
|
clearEndZoneOffset()
Sets the start zone offset of this record to system default. |
HeartRateRecord.Builder
|
clearStartZoneOffset()
Sets the start zone offset of this record to system default. |
HeartRateRecord.Builder
|
setEndZoneOffset(ZoneOffset endZoneOffset)
Sets the zone offset of the user when the activity ended. |
HeartRateRecord.Builder
|
setStartZoneOffset(ZoneOffset startZoneOffset)
Sets the zone offset of the user when the activity started. |
Inherited methods | |
|---|---|
Public constructors
Builder
public Builder (Metadata metadata, Instant startTime, Instant endTime, List<HeartRateRecord.HeartRateSample> heartRateSamples)
Make a builder for HeartRateRecord initialized with the given data.
| 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 |
List: Samples of recorded heart rate. Only a single sample with a given
time is accepted and samples with duplicate times will be silently dropped.
This value cannot be null. |
| Throws | |
|---|---|
IllegalArgumentException |
if heartRateSamples is empty |
Public methods
build
public HeartRateRecord build ()
| Returns | |
|---|---|
HeartRateRecord |
Object of HeartRateRecord
This value cannot be null. |
clearEndZoneOffset
public HeartRateRecord.Builder clearEndZoneOffset ()
Sets the start zone offset of this record to system default.
| Returns | |
|---|---|
HeartRateRecord.Builder |
This value cannot be null. |
clearStartZoneOffset
public HeartRateRecord.Builder clearStartZoneOffset ()
Sets the start zone offset of this record to system default.
| Returns | |
|---|---|
HeartRateRecord.Builder |
This value cannot be null. |
setEndZoneOffset
public HeartRateRecord.Builder setEndZoneOffset (ZoneOffset endZoneOffset)
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. |
| Returns | |
|---|---|
HeartRateRecord.Builder |
This value cannot be null. |
setStartZoneOffset
public HeartRateRecord.Builder setStartZoneOffset (ZoneOffset startZoneOffset)
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. |
| Returns | |
|---|---|
HeartRateRecord.Builder |
This value cannot be null. |