Class Sleep.SleepSummary.Builder (0.2.0)

public static final class Sleep.SleepSummary.Builder extends GeneratedMessage.Builder<Sleep.SleepSummary.Builder> implements Sleep.SleepSummaryOrBuilder

Sleep summary: metrics and stages summary.

Protobuf type google.devicesandservices.health.v4.Sleep.SleepSummary

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllStagesSummary(Iterable<? extends Sleep.SleepSummary.StageSummary> values)

public Sleep.SleepSummary.Builder addAllStagesSummary(Iterable<? extends Sleep.SleepSummary.StageSummary> values)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary>
Returns
Type Description
Sleep.SleepSummary.Builder

addStagesSummary(Sleep.SleepSummary.StageSummary value)

public Sleep.SleepSummary.Builder addStagesSummary(Sleep.SleepSummary.StageSummary value)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Sleep.SleepSummary.StageSummary
Returns
Type Description
Sleep.SleepSummary.Builder

addStagesSummary(Sleep.SleepSummary.StageSummary.Builder builderForValue)

public Sleep.SleepSummary.Builder addStagesSummary(Sleep.SleepSummary.StageSummary.Builder builderForValue)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Sleep.SleepSummary.StageSummary.Builder
Returns
Type Description
Sleep.SleepSummary.Builder

addStagesSummary(int index, Sleep.SleepSummary.StageSummary value)

public Sleep.SleepSummary.Builder addStagesSummary(int index, Sleep.SleepSummary.StageSummary value)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value Sleep.SleepSummary.StageSummary
Returns
Type Description
Sleep.SleepSummary.Builder

addStagesSummary(int index, Sleep.SleepSummary.StageSummary.Builder builderForValue)

public Sleep.SleepSummary.Builder addStagesSummary(int index, Sleep.SleepSummary.StageSummary.Builder builderForValue)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue Sleep.SleepSummary.StageSummary.Builder
Returns
Type Description
Sleep.SleepSummary.Builder

addStagesSummaryBuilder()

public Sleep.SleepSummary.StageSummary.Builder addStagesSummaryBuilder()

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummary.StageSummary.Builder

addStagesSummaryBuilder(int index)

public Sleep.SleepSummary.StageSummary.Builder addStagesSummaryBuilder(int index)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Sleep.SleepSummary.StageSummary.Builder

build()

public Sleep.SleepSummary build()
Returns
Type Description
Sleep.SleepSummary

buildPartial()

public Sleep.SleepSummary buildPartial()
Returns
Type Description
Sleep.SleepSummary

clear()

public Sleep.SleepSummary.Builder clear()
Returns
Type Description
Sleep.SleepSummary.Builder
Overrides

clearMinutesAfterWakeUp()

public Sleep.SleepSummary.Builder clearMinutesAfterWakeUp()

Output only. Minutes after wake up calculated by restlessness algorithm.

optional int64 minutes_after_wake_up = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

clearMinutesAsleep()

public Sleep.SleepSummary.Builder clearMinutesAsleep()

Output only. Total number of minutes asleep. For classic sleep it is the sum of ASLEEP stages (excluding AWAKE and RESTLESS). For "stages" sleep it is the sum of LIGHT, REM and DEEP stages (excluding AWAKE).

optional int64 minutes_asleep = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

clearMinutesAwake()

public Sleep.SleepSummary.Builder clearMinutesAwake()

Output only. Total number of minutes awake. It is a sum of all AWAKE stages.

optional int64 minutes_awake = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

clearMinutesInSleepPeriod()

public Sleep.SleepSummary.Builder clearMinutesInSleepPeriod()

Output only. Delta between wake time and bedtime. It is the sum of all stages.

optional int64 minutes_in_sleep_period = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

clearMinutesToFallAsleep()

public Sleep.SleepSummary.Builder clearMinutesToFallAsleep()

Output only. Minutes to fall asleep calculated by restlessness algorithm.

optional int64 minutes_to_fall_asleep = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

clearStagesSummary()

public Sleep.SleepSummary.Builder clearStagesSummary()

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummary.Builder

getDefaultInstanceForType()

public Sleep.SleepSummary getDefaultInstanceForType()
Returns
Type Description
Sleep.SleepSummary

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMinutesAfterWakeUp()

public long getMinutesAfterWakeUp()

Output only. Minutes after wake up calculated by restlessness algorithm.

optional int64 minutes_after_wake_up = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
long

The minutesAfterWakeUp.

getMinutesAsleep()

public long getMinutesAsleep()

Output only. Total number of minutes asleep. For classic sleep it is the sum of ASLEEP stages (excluding AWAKE and RESTLESS). For "stages" sleep it is the sum of LIGHT, REM and DEEP stages (excluding AWAKE).

optional int64 minutes_asleep = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
long

The minutesAsleep.

getMinutesAwake()

public long getMinutesAwake()

Output only. Total number of minutes awake. It is a sum of all AWAKE stages.

optional int64 minutes_awake = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
long

The minutesAwake.

getMinutesInSleepPeriod()

public long getMinutesInSleepPeriod()

Output only. Delta between wake time and bedtime. It is the sum of all stages.

optional int64 minutes_in_sleep_period = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
long

The minutesInSleepPeriod.

getMinutesToFallAsleep()

public long getMinutesToFallAsleep()

Output only. Minutes to fall asleep calculated by restlessness algorithm.

optional int64 minutes_to_fall_asleep = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
long

The minutesToFallAsleep.

getStagesSummary(int index)

public Sleep.SleepSummary.StageSummary getStagesSummary(int index)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Sleep.SleepSummary.StageSummary

getStagesSummaryBuilder(int index)

public Sleep.SleepSummary.StageSummary.Builder getStagesSummaryBuilder(int index)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Sleep.SleepSummary.StageSummary.Builder

getStagesSummaryBuilderList()

public List<Sleep.SleepSummary.StageSummary.Builder> getStagesSummaryBuilderList()

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Builder>

getStagesSummaryCount()

public int getStagesSummaryCount()

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getStagesSummaryList()

public List<Sleep.SleepSummary.StageSummary> getStagesSummaryList()

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<StageSummary>

getStagesSummaryOrBuilder(int index)

public Sleep.SleepSummary.StageSummaryOrBuilder getStagesSummaryOrBuilder(int index)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Sleep.SleepSummary.StageSummaryOrBuilder

getStagesSummaryOrBuilderList()

public List<? extends Sleep.SleepSummary.StageSummaryOrBuilder> getStagesSummaryOrBuilderList()

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummaryOrBuilder>

hasMinutesAfterWakeUp()

public boolean hasMinutesAfterWakeUp()

Output only. Minutes after wake up calculated by restlessness algorithm.

optional int64 minutes_after_wake_up = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the minutesAfterWakeUp field is set.

hasMinutesAsleep()

public boolean hasMinutesAsleep()

Output only. Total number of minutes asleep. For classic sleep it is the sum of ASLEEP stages (excluding AWAKE and RESTLESS). For "stages" sleep it is the sum of LIGHT, REM and DEEP stages (excluding AWAKE).

optional int64 minutes_asleep = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the minutesAsleep field is set.

hasMinutesAwake()

public boolean hasMinutesAwake()

Output only. Total number of minutes awake. It is a sum of all AWAKE stages.

optional int64 minutes_awake = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the minutesAwake field is set.

hasMinutesInSleepPeriod()

public boolean hasMinutesInSleepPeriod()

Output only. Delta between wake time and bedtime. It is the sum of all stages.

optional int64 minutes_in_sleep_period = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the minutesInSleepPeriod field is set.

hasMinutesToFallAsleep()

public boolean hasMinutesToFallAsleep()

Output only. Minutes to fall asleep calculated by restlessness algorithm.

optional int64 minutes_to_fall_asleep = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the minutesToFallAsleep field is set.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Sleep.SleepSummary other)

public Sleep.SleepSummary.Builder mergeFrom(Sleep.SleepSummary other)
Parameter
Name Description
other Sleep.SleepSummary
Returns
Type Description
Sleep.SleepSummary.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Sleep.SleepSummary.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Sleep.SleepSummary.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Sleep.SleepSummary.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Sleep.SleepSummary.Builder
Overrides

removeStagesSummary(int index)

public Sleep.SleepSummary.Builder removeStagesSummary(int index)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Sleep.SleepSummary.Builder

setMinutesAfterWakeUp(long value)

public Sleep.SleepSummary.Builder setMinutesAfterWakeUp(long value)

Output only. Minutes after wake up calculated by restlessness algorithm.

optional int64 minutes_after_wake_up = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value long

The minutesAfterWakeUp to set.

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

setMinutesAsleep(long value)

public Sleep.SleepSummary.Builder setMinutesAsleep(long value)

Output only. Total number of minutes asleep. For classic sleep it is the sum of ASLEEP stages (excluding AWAKE and RESTLESS). For "stages" sleep it is the sum of LIGHT, REM and DEEP stages (excluding AWAKE).

optional int64 minutes_asleep = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value long

The minutesAsleep to set.

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

setMinutesAwake(long value)

public Sleep.SleepSummary.Builder setMinutesAwake(long value)

Output only. Total number of minutes awake. It is a sum of all AWAKE stages.

optional int64 minutes_awake = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value long

The minutesAwake to set.

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

setMinutesInSleepPeriod(long value)

public Sleep.SleepSummary.Builder setMinutesInSleepPeriod(long value)

Output only. Delta between wake time and bedtime. It is the sum of all stages.

optional int64 minutes_in_sleep_period = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value long

The minutesInSleepPeriod to set.

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

setMinutesToFallAsleep(long value)

public Sleep.SleepSummary.Builder setMinutesToFallAsleep(long value)

Output only. Minutes to fall asleep calculated by restlessness algorithm.

optional int64 minutes_to_fall_asleep = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value long

The minutesToFallAsleep to set.

Returns
Type Description
Sleep.SleepSummary.Builder

This builder for chaining.

setStagesSummary(int index, Sleep.SleepSummary.StageSummary value)

public Sleep.SleepSummary.Builder setStagesSummary(int index, Sleep.SleepSummary.StageSummary value)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value Sleep.SleepSummary.StageSummary
Returns
Type Description
Sleep.SleepSummary.Builder

setStagesSummary(int index, Sleep.SleepSummary.StageSummary.Builder builderForValue)

public Sleep.SleepSummary.Builder setStagesSummary(int index, Sleep.SleepSummary.StageSummary.Builder builderForValue)

Output only. List of summaries (total duration and segment count) per each sleep stage type.

repeated .google.devicesandservices.health.v4.Sleep.SleepSummary.StageSummary stages_summary = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue Sleep.SleepSummary.StageSummary.Builder
Returns
Type Description
Sleep.SleepSummary.Builder