Class DataSource.Builder (0.2.0)

public static final class DataSource.Builder extends GeneratedMessage.Builder<DataSource.Builder> 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 Methods

getDescriptor()

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

Methods

build()

public DataSource build()
Returns
Type Description
DataSource

buildPartial()

public DataSource buildPartial()
Returns
Type Description
DataSource

clear()

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

clearApplication()

public DataSource.Builder clearApplication()

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.Builder

clearDevice()

public DataSource.Builder clearDevice()

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.Builder

clearPlatform()

public DataSource.Builder clearPlatform()

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.Builder

This builder for chaining.

clearRecordingMethod()

public DataSource.Builder clearRecordingMethod()

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.Builder

This builder for chaining.

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.

getApplicationBuilder()

public DataSource.Application.Builder getApplicationBuilder()

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.Builder

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

getDescriptorForType()

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

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.

getDeviceBuilder()

public DataSource.Device.Builder getDeviceBuilder()

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.Builder

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

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.

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.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeApplication(DataSource.Application value)

public DataSource.Builder mergeApplication(DataSource.Application value)

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];

Parameter
Name Description
value DataSource.Application
Returns
Type Description
DataSource.Builder

mergeDevice(DataSource.Device value)

public DataSource.Builder mergeDevice(DataSource.Device value)

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];

Parameter
Name Description
value DataSource.Device
Returns
Type Description
DataSource.Builder

mergeFrom(DataSource other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

setApplication(DataSource.Application value)

public DataSource.Builder setApplication(DataSource.Application value)

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];

Parameter
Name Description
value DataSource.Application
Returns
Type Description
DataSource.Builder

setApplication(DataSource.Application.Builder builderForValue)

public DataSource.Builder setApplication(DataSource.Application.Builder builderForValue)

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];

Parameter
Name Description
builderForValue DataSource.Application.Builder
Returns
Type Description
DataSource.Builder

setDevice(DataSource.Device value)

public DataSource.Builder setDevice(DataSource.Device value)

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];

Parameter
Name Description
value DataSource.Device
Returns
Type Description
DataSource.Builder

setDevice(DataSource.Device.Builder builderForValue)

public DataSource.Builder setDevice(DataSource.Device.Builder builderForValue)

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];

Parameter
Name Description
builderForValue DataSource.Device.Builder
Returns
Type Description
DataSource.Builder

setPlatform(DataSource.Platform value)

public DataSource.Builder setPlatform(DataSource.Platform value)

Output only. Captures the platform that uploaded the data.

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

Parameter
Name Description
value DataSource.Platform

The platform to set.

Returns
Type Description
DataSource.Builder

This builder for chaining.

setPlatformValue(int value)

public DataSource.Builder setPlatformValue(int value)

Output only. Captures the platform that uploaded the data.

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

Parameter
Name Description
value int

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

Returns
Type Description
DataSource.Builder

This builder for chaining.

setRecordingMethod(DataSource.RecordingMethod value)

public DataSource.Builder setRecordingMethod(DataSource.RecordingMethod value)

Optional. Captures how the data was recorded.

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

Parameter
Name Description
value DataSource.RecordingMethod

The recordingMethod to set.

Returns
Type Description
DataSource.Builder

This builder for chaining.

setRecordingMethodValue(int value)

public DataSource.Builder setRecordingMethodValue(int value)

Optional. Captures how the data was recorded.

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

Parameter
Name Description
value int

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

Returns
Type Description
DataSource.Builder

This builder for chaining.