Builder
class Builder
kotlin.Any | |
↳ | android.health.connect.datatypes.SleepSessionRecord.Builder |
Builder class for SleepSessionRecord
Summary
Public constructors | |
---|---|
Public methods | |
---|---|
SleepSessionRecord |
build() Returns |
SleepSessionRecord.Builder |
Sets the start zone offset of this record to system default. |
SleepSessionRecord.Builder |
Sets the start zone offset of this record to system default. |
SleepSessionRecord.Builder |
setEndZoneOffset(endZoneOffset: ZoneOffset) Sets the zone offset of the user when the activity ended |
SleepSessionRecord.Builder |
setNotes(notes: CharSequence?) Sets notes for this activity |
SleepSessionRecord.Builder |
setStages(stages: MutableList<SleepSessionRecord.Stage!>) Set stages to this sleep session. |
SleepSessionRecord.Builder |
setStartZoneOffset(startZoneOffset: ZoneOffset) Sets the zone offset of the user when the activity started |
SleepSessionRecord.Builder |
setTitle(title: CharSequence?) Sets a title of this activity |
Public constructors
Builder
Builder(
metadata: Metadata,
startTime: Instant,
endTime: Instant)
Parameters | |
---|---|
metadata |
Metadata: Metadata to be associated with the record. See Metadata . This value cannot be null . |
startTime |
Instant: Start time of this sleep session This value cannot be null . |
endTime |
Instant: End time of this sleep session This value cannot be null . |
Public methods
build
fun build(): SleepSessionRecord
Returns SleepSessionRecord
Return | |
---|---|
SleepSessionRecord |
This value cannot be null . |
clearEndZoneOffset
fun clearEndZoneOffset(): SleepSessionRecord.Builder
Sets the start zone offset of this record to system default.
Return | |
---|---|
SleepSessionRecord.Builder |
This value cannot be null . |
clearStartZoneOffset
fun clearStartZoneOffset(): SleepSessionRecord.Builder
Sets the start zone offset of this record to system default.
Return | |
---|---|
SleepSessionRecord.Builder |
This value cannot be null . |
setEndZoneOffset
fun setEndZoneOffset(endZoneOffset: ZoneOffset): SleepSessionRecord.Builder
Sets the zone offset of the user when the activity ended
Parameters | |
---|---|
endZoneOffset |
ZoneOffset: This value cannot be null . |
Return | |
---|---|
SleepSessionRecord.Builder |
This value cannot be null . |
setNotes
fun setNotes(notes: CharSequence?): SleepSessionRecord.Builder
Sets notes for this activity
Parameters | |
---|---|
notes |
CharSequence?: Additional notes for the session. Optional field. This value may be null . |
Return | |
---|---|
SleepSessionRecord.Builder |
This value cannot be null . |
setStages
fun setStages(stages: MutableList<SleepSessionRecord.Stage!>): SleepSessionRecord.Builder
Set stages to this sleep session. Returns Object with updated stages.
Parameters | |
---|---|
stages |
MutableList<SleepSessionRecord.Stage!>: list of stages to set This value cannot be null . |
Return | |
---|---|
SleepSessionRecord.Builder |
This value cannot be null . |
setStartZoneOffset
fun setStartZoneOffset(startZoneOffset: ZoneOffset): SleepSessionRecord.Builder
Sets the zone offset of the user when the activity started
Parameters | |
---|---|
startZoneOffset |
ZoneOffset: This value cannot be null . |
Return | |
---|---|
SleepSessionRecord.Builder |
This value cannot be null . |
setTitle
fun setTitle(title: CharSequence?): SleepSessionRecord.Builder
Sets a title of this activity
Parameters | |
---|---|
title |
CharSequence?: Title of the session. Optional field. This value may be null . |
Return | |
---|---|
SleepSessionRecord.Builder |
This value cannot be null . |