Class Sleep (0.2.0)

public final class Sleep extends GeneratedMessage implements SleepOrBuilder

A sleep session possibly including stages.

Protobuf type google.devicesandservices.health.v4.Sleep

Implements

SleepOrBuilder

Static Fields

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

INTERVAL_FIELD_NUMBER

public static final int INTERVAL_FIELD_NUMBER
Field Value
Type Description
int

METADATA_FIELD_NUMBER

public static final int METADATA_FIELD_NUMBER
Field Value
Type Description
int

OUT_OF_BED_SEGMENTS_FIELD_NUMBER

public static final int OUT_OF_BED_SEGMENTS_FIELD_NUMBER
Field Value
Type Description
int

STAGES_FIELD_NUMBER

public static final int STAGES_FIELD_NUMBER
Field Value
Type Description
int

SUMMARY_FIELD_NUMBER

public static final int SUMMARY_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Sleep getDefaultInstance()
Returns
Type Description
Sleep

getDescriptor()

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

newBuilder()

public static Sleep.Builder newBuilder()
Returns
Type Description
Sleep.Builder

newBuilder(Sleep prototype)

public static Sleep.Builder newBuilder(Sleep prototype)
Parameter
Name Description
prototype Sleep
Returns
Type Description
Sleep.Builder

parseDelimitedFrom(InputStream input)

public static Sleep parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Sleep
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Sleep parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Sleep
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Sleep parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Sleep
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Sleep parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Sleep
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Sleep parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Sleep
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Sleep parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Sleep
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Sleep parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Sleep
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Sleep parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Sleep
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Sleep parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Sleep
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Sleep parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Sleep
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Sleep parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Sleep
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Sleep parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Sleep
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Sleep> parser()
Returns
Type Description
Parser<Sleep>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

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.

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

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.

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.

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

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>

getParserForType()

public Parser<Sleep> getParserForType()
Returns
Type Description
Parser<Sleep>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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

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.

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.

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Sleep.Builder newBuilderForType()
Returns
Type Description
Sleep.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

protected Sleep.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Sleep.Builder
Overrides

toBuilder()

public Sleep.Builder toBuilder()
Returns
Type Description
Sleep.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException