Builder


class Builder
kotlin.Any
   ↳ android.health.connect.datatypes.Metadata.Builder

Summary

Public constructors

Public methods
Metadata

Metadata.Builder
setClientRecordId(clientRecordId: String?)

Sets optional client supplied record unique data identifier associated with the data.

Metadata.Builder
setClientRecordVersion(clientRecordVersion: Long)

Sets optional client supplied version associated with the data.

Metadata.Builder

Sets where the data comes from, such as application information originally generated this data.

Metadata.Builder
setDevice(device: Device)

Sets optional client supplied device information associated with the data.

Metadata.Builder

Sets unique identifier of this data, assigned by the Android Health Platform at insertion time.

Metadata.Builder
setLastModifiedTime(lastModifiedTime: Instant)

Sets when data was last modified (or originally created).

Metadata.Builder
setRecordingMethod(recordingMethod: Int)

Sets recording method for the Record.

Public constructors

Builder

Builder()

Public methods

build

fun build(): Metadata
Return
Metadata Metadata object.
This value cannot be null.

setClientRecordId

fun setClientRecordId(clientRecordId: String?): Metadata.Builder

Sets optional client supplied record unique data identifier associated with the data. There is guaranteed a single entry for any type of data with same client provided identifier for a given client. Any new insertions with the same client provided identifier will either replace or be ignored depending on associated clientRecordVersion. @see clientRecordVersion

A null value means that no clientRecordId is set

Parameters
clientRecordId String?: This value may be null.

setClientRecordVersion

fun setClientRecordVersion(clientRecordVersion: Long): Metadata.Builder

Sets optional client supplied version associated with the data. This determines conflict resolution outcome when there are multiple insertions of the same clientRecordId. Data with the highest clientRecordVersion takes precedence. clientRecordVersion starts with 0. @see clientRecordId

Return
Metadata.Builder This value cannot be null.

setDataOrigin

fun setDataOrigin(dataOrigin: DataOrigin): Metadata.Builder

Sets where the data comes from, such as application information originally generated this data. When Record is created before insertion, this contains a sentinel value, any assigned value will be ignored. After insertion, this will be populated with inserted application.

Parameters
dataOrigin DataOrigin: This value cannot be null.
Return
Metadata.Builder This value cannot be null.

setDevice

fun setDevice(device: Device): Metadata.Builder

Sets optional client supplied device information associated with the data.

Parameters
device Device: This value cannot be null.
Return
Metadata.Builder This value cannot be null.

setId

fun setId(id: String): Metadata.Builder

Sets unique identifier of this data, assigned by the Android Health Platform at insertion time. When Record is created before insertion, this takes a sentinel value, any assigned value will be ignored.

Parameters
id String: This value cannot be null.
Return
Metadata.Builder This value cannot be null.

setLastModifiedTime

fun setLastModifiedTime(lastModifiedTime: Instant): Metadata.Builder

Sets when data was last modified (or originally created). When Record is created before inserted, this contains a sentinel value, any assigned value will be ignored.

Parameters
lastModifiedTime Instant: This value cannot be null.
Return
Metadata.Builder This value cannot be null.

setRecordingMethod

fun setRecordingMethod(recordingMethod: Int): Metadata.Builder

Sets recording method for the Record. This detail helps to know how the data was recorded which can be useful for prioritization of the record

Parameters
recordingMethod Int: Value is one of the following:
Return
Metadata.Builder This value cannot be null.