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