Added in API level 34
Stage
class Stage
kotlin.Any | |
↳ | android.health.connect.datatypes.SleepSessionRecord.Stage |
Captures the user's length and type of sleep. Each record represents a time interval for a stage of sleep.
The start time of the record represents the start and end time of the sleep stage and always need to be included.
Summary
Public constructors | |
---|---|
Builds |
Public methods | |
---|---|
open Boolean | |
open Instant |
Returns end time of this stage. |
open Instant |
Returns start time of this stage. |
open Int |
getType() Returns stage type. |
open Int |
hashCode() |
Public constructors
Stage
Added in API level 34
Stage(
startTime: Instant,
endTime: Instant,
stageType: Int)
Builds Stage
instance
Parameters | |
---|---|
startTime |
Instant: start time of the stage This value cannot be null . |
endTime |
Instant: end time of the stage. Must not be earlier than start time. This value cannot be null . |
stageType |
Int: type of the stage. One of StageType Value is android.health.connect.datatypes.SleepSessionRecord.StageType#STAGE_TYPE_UNKNOWN , android.health.connect.datatypes.SleepSessionRecord.StageType#STAGE_TYPE_AWAKE , android.health.connect.datatypes.SleepSessionRecord.StageType#STAGE_TYPE_SLEEPING , android.health.connect.datatypes.SleepSessionRecord.StageType#STAGE_TYPE_AWAKE_OUT_OF_BED , android.health.connect.datatypes.SleepSessionRecord.StageType#STAGE_TYPE_SLEEPING_LIGHT , android.health.connect.datatypes.SleepSessionRecord.StageType#STAGE_TYPE_SLEEPING_DEEP , android.health.connect.datatypes.SleepSessionRecord.StageType#STAGE_TYPE_SLEEPING_REM , or android.health.connect.datatypes.SleepSessionRecord.StageType#STAGE_TYPE_AWAKE_IN_BED |
Public methods
equals
Added in API level 34
open fun equals(other: Any?): Boolean
Parameters | |
---|---|
obj |
the reference object with which to compare. |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getEndTime
Added in API level 34
open fun getEndTime(): Instant
Returns end time of this stage.
Return | |
---|---|
Instant |
This value cannot be null . |
getStartTime
Added in API level 34
open fun getStartTime(): Instant
Returns start time of this stage.
Return | |
---|---|
Instant |
This value cannot be null . |
getType
Added in API level 34
open fun getType(): Int
Returns stage type.
hashCode
Added in API level 34
open fun hashCode(): Int
Return | |
---|---|
Int |
a hash code value for this object. |