Class Sleep.Builder (0.2.0)

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

A sleep session possibly including stages.

Protobuf type google.devicesandservices.health.v4.Sleep

Implements

SleepOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllOutOfBedSegments(Iterable<? extends Sleep.OutOfBedSegment> values)

public Sleep.Builder addAllOutOfBedSegments(Iterable<? extends Sleep.OutOfBedSegment> values)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

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

addAllStages(Iterable<? extends Sleep.SleepStage> values)

public Sleep.Builder addAllStages(Iterable<? extends Sleep.SleepStage> values)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

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

addOutOfBedSegments(Sleep.OutOfBedSegment value)

public Sleep.Builder addOutOfBedSegments(Sleep.OutOfBedSegment value)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Sleep.OutOfBedSegment
Returns
Type Description
Sleep.Builder

addOutOfBedSegments(Sleep.OutOfBedSegment.Builder builderForValue)

public Sleep.Builder addOutOfBedSegments(Sleep.OutOfBedSegment.Builder builderForValue)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue Sleep.OutOfBedSegment.Builder
Returns
Type Description
Sleep.Builder

addOutOfBedSegments(int index, Sleep.OutOfBedSegment value)

public Sleep.Builder addOutOfBedSegments(int index, Sleep.OutOfBedSegment value)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value Sleep.OutOfBedSegment
Returns
Type Description
Sleep.Builder

addOutOfBedSegments(int index, Sleep.OutOfBedSegment.Builder builderForValue)

public Sleep.Builder addOutOfBedSegments(int index, Sleep.OutOfBedSegment.Builder builderForValue)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue Sleep.OutOfBedSegment.Builder
Returns
Type Description
Sleep.Builder

addOutOfBedSegmentsBuilder()

public Sleep.OutOfBedSegment.Builder addOutOfBedSegmentsBuilder()

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.OutOfBedSegment.Builder

addOutOfBedSegmentsBuilder(int index)

public Sleep.OutOfBedSegment.Builder addOutOfBedSegmentsBuilder(int index)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

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

addStages(Sleep.SleepStage value)

public Sleep.Builder addStages(Sleep.SleepStage value)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Sleep.SleepStage
Returns
Type Description
Sleep.Builder

addStages(Sleep.SleepStage.Builder builderForValue)

public Sleep.Builder addStages(Sleep.SleepStage.Builder builderForValue)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue Sleep.SleepStage.Builder
Returns
Type Description
Sleep.Builder

addStages(int index, Sleep.SleepStage value)

public Sleep.Builder addStages(int index, Sleep.SleepStage value)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value Sleep.SleepStage
Returns
Type Description
Sleep.Builder

addStages(int index, Sleep.SleepStage.Builder builderForValue)

public Sleep.Builder addStages(int index, Sleep.SleepStage.Builder builderForValue)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue Sleep.SleepStage.Builder
Returns
Type Description
Sleep.Builder

addStagesBuilder()

public Sleep.SleepStage.Builder addStagesBuilder()

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.SleepStage.Builder

addStagesBuilder(int index)

public Sleep.SleepStage.Builder addStagesBuilder(int index)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

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

build()

public Sleep build()
Returns
Type Description
Sleep

buildPartial()

public Sleep buildPartial()
Returns
Type Description
Sleep

clear()

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

clearCreateTime()

public Sleep.Builder clearCreateTime()

Output only. Creation time of this sleep observation.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.Builder

clearInterval()

public Sleep.Builder clearInterval()

Required. Observed sleep interval.

.google.devicesandservices.health.v4.SessionTimeInterval interval = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Sleep.Builder

clearMetadata()

public Sleep.Builder clearMetadata()

Optional. Sleep metadata: processing, main, manually edited, stages status.

.google.devicesandservices.health.v4.Sleep.SleepMetadata metadata = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.Builder

clearOutOfBedSegments()

public Sleep.Builder clearOutOfBedSegments()

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.Builder

clearStages()

public Sleep.Builder clearStages()

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.Builder

clearSummary()

public Sleep.Builder clearSummary()

Output only. Sleep summary: metrics and stages summary.

.google.devicesandservices.health.v4.Sleep.SleepSummary summary = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.Builder

clearType()

public Sleep.Builder clearType()

Optional. SleepType: classic or stages.

.google.devicesandservices.health.v4.Sleep.SleepType type = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.Builder

This builder for chaining.

clearUpdateTime()

public Sleep.Builder clearUpdateTime()

Output only. Last update time of this sleep observation.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.Builder

getCreateTime()

public Timestamp getCreateTime()

Output only. Creation time of this sleep observation.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeBuilder()

public Timestamp.Builder getCreateTimeBuilder()

Output only. Creation time of this sleep observation.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Creation time of this sleep observation.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public Sleep getDefaultInstanceForType()
Returns
Type Description
Sleep

getDescriptorForType()

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

getInterval()

public SessionTimeInterval getInterval()

Required. Observed sleep interval.

.google.devicesandservices.health.v4.SessionTimeInterval interval = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
SessionTimeInterval

The interval.

getIntervalBuilder()

public SessionTimeInterval.Builder getIntervalBuilder()

Required. Observed sleep interval.

.google.devicesandservices.health.v4.SessionTimeInterval interval = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
SessionTimeInterval.Builder

getIntervalOrBuilder()

public SessionTimeIntervalOrBuilder getIntervalOrBuilder()

Required. Observed sleep interval.

.google.devicesandservices.health.v4.SessionTimeInterval interval = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
SessionTimeIntervalOrBuilder

getMetadata()

public Sleep.SleepMetadata getMetadata()

Optional. Sleep metadata: processing, main, manually edited, stages status.

.google.devicesandservices.health.v4.Sleep.SleepMetadata metadata = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.SleepMetadata

The metadata.

getMetadataBuilder()

public Sleep.SleepMetadata.Builder getMetadataBuilder()

Optional. Sleep metadata: processing, main, manually edited, stages status.

.google.devicesandservices.health.v4.Sleep.SleepMetadata metadata = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.SleepMetadata.Builder

getMetadataOrBuilder()

public Sleep.SleepMetadataOrBuilder getMetadataOrBuilder()

Optional. Sleep metadata: processing, main, manually edited, stages status.

.google.devicesandservices.health.v4.Sleep.SleepMetadata metadata = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.SleepMetadataOrBuilder

getOutOfBedSegments(int index)

public Sleep.OutOfBedSegment getOutOfBedSegments(int index)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Sleep.OutOfBedSegment

getOutOfBedSegmentsBuilder(int index)

public Sleep.OutOfBedSegment.Builder getOutOfBedSegmentsBuilder(int index)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

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

getOutOfBedSegmentsBuilderList()

public List<Sleep.OutOfBedSegment.Builder> getOutOfBedSegmentsBuilderList()

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Builder>

getOutOfBedSegmentsCount()

public int getOutOfBedSegmentsCount()

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getOutOfBedSegmentsList()

public List<Sleep.OutOfBedSegment> getOutOfBedSegmentsList()

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<OutOfBedSegment>

getOutOfBedSegmentsOrBuilder(int index)

public Sleep.OutOfBedSegmentOrBuilder getOutOfBedSegmentsOrBuilder(int index)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Sleep.OutOfBedSegmentOrBuilder

getOutOfBedSegmentsOrBuilderList()

public List<? extends Sleep.OutOfBedSegmentOrBuilder> getOutOfBedSegmentsOrBuilderList()

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

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

getStages(int index)

public Sleep.SleepStage getStages(int index)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Sleep.SleepStage

getStagesBuilder(int index)

public Sleep.SleepStage.Builder getStagesBuilder(int index)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

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

getStagesBuilderList()

public List<Sleep.SleepStage.Builder> getStagesBuilderList()

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Builder>

getStagesCount()

public int getStagesCount()

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getStagesList()

public List<Sleep.SleepStage> getStagesList()

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<SleepStage>

getStagesOrBuilder(int index)

public Sleep.SleepStageOrBuilder getStagesOrBuilder(int index)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Sleep.SleepStageOrBuilder

getStagesOrBuilderList()

public List<? extends Sleep.SleepStageOrBuilder> getStagesOrBuilderList()

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

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

getSummary()

public Sleep.SleepSummary getSummary()

Output only. Sleep summary: metrics and stages summary.

.google.devicesandservices.health.v4.Sleep.SleepSummary summary = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummary

The summary.

getSummaryBuilder()

public Sleep.SleepSummary.Builder getSummaryBuilder()

Output only. Sleep summary: metrics and stages summary.

.google.devicesandservices.health.v4.Sleep.SleepSummary summary = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummary.Builder

getSummaryOrBuilder()

public Sleep.SleepSummaryOrBuilder getSummaryOrBuilder()

Output only. Sleep summary: metrics and stages summary.

.google.devicesandservices.health.v4.Sleep.SleepSummary summary = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Sleep.SleepSummaryOrBuilder

getType()

public Sleep.SleepType getType()

Optional. SleepType: classic or stages.

.google.devicesandservices.health.v4.Sleep.SleepType type = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Sleep.SleepType

The type.

getTypeValue()

public int getTypeValue()

Optional. SleepType: classic or stages.

.google.devicesandservices.health.v4.Sleep.SleepType type = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The enum numeric value on the wire for type.

getUpdateTime()

public Timestamp getUpdateTime()

Output only. Last update time of this sleep observation.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeBuilder()

public Timestamp.Builder getUpdateTimeBuilder()

Output only. Last update time of this sleep observation.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. Last update time of this sleep observation.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

hasCreateTime()

public boolean hasCreateTime()

Output only. Creation time of this sleep observation.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasInterval()

public boolean hasInterval()

Required. Observed sleep interval.

.google.devicesandservices.health.v4.SessionTimeInterval interval = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the interval field is set.

hasMetadata()

public boolean hasMetadata()

Optional. Sleep metadata: processing, main, manually edited, stages status.

.google.devicesandservices.health.v4.Sleep.SleepMetadata metadata = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the metadata field is set.

hasSummary()

public boolean hasSummary()

Output only. Sleep summary: metrics and stages summary.

.google.devicesandservices.health.v4.Sleep.SleepSummary summary = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the summary field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. Last update time of this sleep observation.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the updateTime field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeCreateTime(Timestamp value)

public Sleep.Builder mergeCreateTime(Timestamp value)

Output only. Creation time of this sleep observation.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Sleep.Builder

mergeFrom(Sleep other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeInterval(SessionTimeInterval value)

public Sleep.Builder mergeInterval(SessionTimeInterval value)

Required. Observed sleep interval.

.google.devicesandservices.health.v4.SessionTimeInterval interval = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value SessionTimeInterval
Returns
Type Description
Sleep.Builder

mergeMetadata(Sleep.SleepMetadata value)

public Sleep.Builder mergeMetadata(Sleep.SleepMetadata value)

Optional. Sleep metadata: processing, main, manually edited, stages status.

.google.devicesandservices.health.v4.Sleep.SleepMetadata metadata = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Sleep.SleepMetadata
Returns
Type Description
Sleep.Builder

mergeSummary(Sleep.SleepSummary value)

public Sleep.Builder mergeSummary(Sleep.SleepSummary value)

Output only. Sleep summary: metrics and stages summary.

.google.devicesandservices.health.v4.Sleep.SleepSummary summary = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

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

mergeUpdateTime(Timestamp value)

public Sleep.Builder mergeUpdateTime(Timestamp value)

Output only. Last update time of this sleep observation.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Sleep.Builder

removeOutOfBedSegments(int index)

public Sleep.Builder removeOutOfBedSegments(int index)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Sleep.Builder

removeStages(int index)

public Sleep.Builder removeStages(int index)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Sleep.Builder

setCreateTime(Timestamp value)

public Sleep.Builder setCreateTime(Timestamp value)

Output only. Creation time of this sleep observation.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Sleep.Builder

setCreateTime(Timestamp.Builder builderForValue)

public Sleep.Builder setCreateTime(Timestamp.Builder builderForValue)

Output only. Creation time of this sleep observation.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Sleep.Builder

setInterval(SessionTimeInterval value)

public Sleep.Builder setInterval(SessionTimeInterval value)

Required. Observed sleep interval.

.google.devicesandservices.health.v4.SessionTimeInterval interval = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value SessionTimeInterval
Returns
Type Description
Sleep.Builder

setInterval(SessionTimeInterval.Builder builderForValue)

public Sleep.Builder setInterval(SessionTimeInterval.Builder builderForValue)

Required. Observed sleep interval.

.google.devicesandservices.health.v4.SessionTimeInterval interval = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue SessionTimeInterval.Builder
Returns
Type Description
Sleep.Builder

setMetadata(Sleep.SleepMetadata value)

public Sleep.Builder setMetadata(Sleep.SleepMetadata value)

Optional. Sleep metadata: processing, main, manually edited, stages status.

.google.devicesandservices.health.v4.Sleep.SleepMetadata metadata = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Sleep.SleepMetadata
Returns
Type Description
Sleep.Builder

setMetadata(Sleep.SleepMetadata.Builder builderForValue)

public Sleep.Builder setMetadata(Sleep.SleepMetadata.Builder builderForValue)

Optional. Sleep metadata: processing, main, manually edited, stages status.

.google.devicesandservices.health.v4.Sleep.SleepMetadata metadata = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue Sleep.SleepMetadata.Builder
Returns
Type Description
Sleep.Builder

setOutOfBedSegments(int index, Sleep.OutOfBedSegment value)

public Sleep.Builder setOutOfBedSegments(int index, Sleep.OutOfBedSegment value)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value Sleep.OutOfBedSegment
Returns
Type Description
Sleep.Builder

setOutOfBedSegments(int index, Sleep.OutOfBedSegment.Builder builderForValue)

public Sleep.Builder setOutOfBedSegments(int index, Sleep.OutOfBedSegment.Builder builderForValue)

Optional. “Out of bed” segments that can overlap with sleep stages.

repeated .google.devicesandservices.health.v4.Sleep.OutOfBedSegment out_of_bed_segments = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue Sleep.OutOfBedSegment.Builder
Returns
Type Description
Sleep.Builder

setStages(int index, Sleep.SleepStage value)

public Sleep.Builder setStages(int index, Sleep.SleepStage value)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value Sleep.SleepStage
Returns
Type Description
Sleep.Builder

setStages(int index, Sleep.SleepStage.Builder builderForValue)

public Sleep.Builder setStages(int index, Sleep.SleepStage.Builder builderForValue)

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period.

repeated .google.devicesandservices.health.v4.Sleep.SleepStage stages = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue Sleep.SleepStage.Builder
Returns
Type Description
Sleep.Builder

setSummary(Sleep.SleepSummary value)

public Sleep.Builder setSummary(Sleep.SleepSummary value)

Output only. Sleep summary: metrics and stages summary.

.google.devicesandservices.health.v4.Sleep.SleepSummary summary = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

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

setSummary(Sleep.SleepSummary.Builder builderForValue)

public Sleep.Builder setSummary(Sleep.SleepSummary.Builder builderForValue)

Output only. Sleep summary: metrics and stages summary.

.google.devicesandservices.health.v4.Sleep.SleepSummary summary = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

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

setType(Sleep.SleepType value)

public Sleep.Builder setType(Sleep.SleepType value)

Optional. SleepType: classic or stages.

.google.devicesandservices.health.v4.Sleep.SleepType type = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Sleep.SleepType

The type to set.

Returns
Type Description
Sleep.Builder

This builder for chaining.

setTypeValue(int value)

public Sleep.Builder setTypeValue(int value)

Optional. SleepType: classic or stages.

.google.devicesandservices.health.v4.Sleep.SleepType type = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value int

The enum numeric value on the wire for type to set.

Returns
Type Description
Sleep.Builder

This builder for chaining.

setUpdateTime(Timestamp value)

public Sleep.Builder setUpdateTime(Timestamp value)

Output only. Last update time of this sleep observation.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Sleep.Builder

setUpdateTime(Timestamp.Builder builderForValue)

public Sleep.Builder setUpdateTime(Timestamp.Builder builderForValue)

Output only. Last update time of this sleep observation.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Sleep.Builder