Class DataSource (0.2.0)

public final class DataSource extends GeneratedMessage implements DataSourceOrBuilder

Data Source definition to track the origin of data.

Each health data point, regardless of the complexity or data model (whether a simple step count or a detailed sleep session) must retain information about its source of origin (e.g. the device or app that collected it).

Protobuf type google.devicesandservices.health.v4.DataSource

Implements

DataSourceOrBuilder

Static Fields

APPLICATION_FIELD_NUMBER

public static final int APPLICATION_FIELD_NUMBER
Field Value
Type Description
int

DEVICE_FIELD_NUMBER

public static final int DEVICE_FIELD_NUMBER
Field Value
Type Description
int

PLATFORM_FIELD_NUMBER

public static final int PLATFORM_FIELD_NUMBER
Field Value
Type Description
int

RECORDING_METHOD_FIELD_NUMBER

public static final int RECORDING_METHOD_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static DataSource getDefaultInstance()
Returns
Type Description
DataSource

getDescriptor()

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

newBuilder()

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

newBuilder(DataSource prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getApplication()

public DataSource.Application getApplication()

Output only. Captures metadata for the application that provided this data.

.google.devicesandservices.health.v4.DataSource.Application application = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DataSource.Application

The application.

getApplicationOrBuilder()

public DataSource.ApplicationOrBuilder getApplicationOrBuilder()

Output only. Captures metadata for the application that provided this data.

.google.devicesandservices.health.v4.DataSource.Application application = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DataSource.ApplicationOrBuilder

getDefaultInstanceForType()

public DataSource getDefaultInstanceForType()
Returns
Type Description
DataSource

getDevice()

public DataSource.Device getDevice()

Optional. Captures metadata for raw data points originating from devices. We expect this data source to be used for data points written on device sync.

.google.devicesandservices.health.v4.DataSource.Device device = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
DataSource.Device

The device.

getDeviceOrBuilder()

public DataSource.DeviceOrBuilder getDeviceOrBuilder()

Optional. Captures metadata for raw data points originating from devices. We expect this data source to be used for data points written on device sync.

.google.devicesandservices.health.v4.DataSource.Device device = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
DataSource.DeviceOrBuilder

getParserForType()

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

getPlatform()

public DataSource.Platform getPlatform()

Output only. Captures the platform that uploaded the data.

.google.devicesandservices.health.v4.DataSource.Platform platform = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DataSource.Platform

The platform.

getPlatformValue()

public int getPlatformValue()

Output only. Captures the platform that uploaded the data.

.google.devicesandservices.health.v4.DataSource.Platform platform = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for platform.

getRecordingMethod()

public DataSource.RecordingMethod getRecordingMethod()

Optional. Captures how the data was recorded.

.google.devicesandservices.health.v4.DataSource.RecordingMethod recording_method = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
DataSource.RecordingMethod

The recordingMethod.

getRecordingMethodValue()

public int getRecordingMethodValue()

Optional. Captures how the data was recorded.

.google.devicesandservices.health.v4.DataSource.RecordingMethod recording_method = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The enum numeric value on the wire for recordingMethod.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasApplication()

public boolean hasApplication()

Output only. Captures metadata for the application that provided this data.

.google.devicesandservices.health.v4.DataSource.Application application = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the application field is set.

hasDevice()

public boolean hasDevice()

Optional. Captures metadata for raw data points originating from devices. We expect this data source to be used for data points written on device sync.

.google.devicesandservices.health.v4.DataSource.Device device = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the device 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 DataSource.Builder newBuilderForType()
Returns
Type Description
DataSource.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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