RecordIdFilter


open class RecordIdFilter
kotlin.Any
   ↳ android.health.connect.RecordIdFilter

A class to represent filtering based on record ID or client ID.

Summary

Public methods
open static RecordIdFilter
fromClientRecordId(recordType: Class<out Record!>, clientRecordId: String)

Creates an instance of Record id filter based on client record id.

open static RecordIdFilter
fromId(recordType: Class<out Record!>, id: String)

Creates an instance of Record id filter based on record id.

open String?

open String?

open Class<out Record!>

Public methods

fromClientRecordId

open static fun fromClientRecordId(
    recordType: Class<out Record!>,
    clientRecordId: String
): RecordIdFilter

Creates an instance of Record id filter based on client record id.

Note: this only works when reading own records, using client record ids to read records inserted by another app will return no result.

Parameters
recordType Class<out Record!>: Record class for which the client record id must be set.
This value cannot be null.
clientRecordId String: Client identifier that was set while inserting the record.
This value cannot be null.
Return
RecordIdFilter Object of RecordIdFilter
This value cannot be null.

fromId

open static fun fromId(
    recordType: Class<out Record!>,
    id: String
): RecordIdFilter

Creates an instance of Record id filter based on record id.

Parameters
recordType Class<out Record!>: Record class for which the id must be set.
This value cannot be null.
id String: Identifier generated by the platform and returned by HealthConnectManager.insertRecords
This value cannot be null.
Return
RecordIdFilter Object of RecordIdFilter
This value cannot be null.

getClientRecordId

open fun getClientRecordId(): String?
Return
String? Client record identifier.
This value may be null.

getId

open fun getId(): String?
Return
String? Identifier given by the platform.
This value may be null.

getRecordType

open fun getRecordType(): Class<out Record!>
Return
Class<out Record!> Record class for this identifier.
This value cannot be null.