Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder<T : Record!>
Builder class for ReadRecordsRequestUsingIds
Summary
Public constructors
Builder
Builder(recordType: Class<T>)
Parameters |
recordType |
Class<T>: Record class for which the id is being set This value cannot be null . |
Public methods
addClientRecordId
fun addClientRecordId(clientRecordId: String): ReadRecordsRequestUsingIds.Builder<T>
Add a client id to the read request.
The maximum number of ids in a single ReadRecordsRequestUsingIds
that Health Connect accepts is 5000. The limit includes all id
s and clientId
s.
Parameters |
clientRecordId |
String: identifier that was set while inserting the record This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ReadRecordsRequestUsingIds.Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/health/connect/ReadRecordsRequestUsingIds.Builder \"View this page in Java\") \n\n```\nclass Builder\u003cT : Record!\u003e\n```\n\n|---|----------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.health.connect.ReadRecordsRequestUsingIds.Builder](#) |\n\nBuilder class for [ReadRecordsRequestUsingIds](/reference/kotlin/android/health/connect/ReadRecordsRequestUsingIds)\n\nSummary\n-------\n\n| Public constructors ||\n|-----------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(java.lang.Class))`(`recordType:` `[Class](../../../java/lang/Class.html#)\u003cT\u003e`)` \u003cbr /\u003e |\n\n| Public methods ||\n|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ReadRecordsRequestUsingIds.Builder](#)\\\u003cT\\\u003e | [addClientRecordId](#addClientRecordId(kotlin.String))`(`clientRecordId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Add a client id to the read request. |\n| [ReadRecordsRequestUsingIds.Builder](#)\\\u003cT\\\u003e | [addId](#addId(kotlin.String))`(`id:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Add an UUID to the read request. |\n| [ReadRecordsRequestUsingIds](/reference/kotlin/android/health/connect/ReadRecordsRequestUsingIds)\\\u003cT\\\u003e | [build](#build())`()` Returns Object of [ReadRecordsRequestUsingIds](/reference/kotlin/android/health/connect/ReadRecordsRequestUsingIds) |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(recordType: Class\u003cT\u003e)\n```\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------|\n| `recordType` | [Class](../../../java/lang/Class.html#)\\\u003cT\\\u003e: Record class for which the id is being set This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### addClientRecordId\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun addClientRecordId(clientRecordId: String): ReadRecordsRequestUsingIds.Builder\u003cT\u003e\n```\n\nAdd a client id to the read request.\n\nThe maximum number of ids in a single [ReadRecordsRequestUsingIds](/reference/kotlin/android/health/connect/ReadRecordsRequestUsingIds) that Health Connect accepts is 5000. The limit includes all `id`s and `clientId`s.\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `clientRecordId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): identifier that was set while inserting the record This value cannot be `null`. |\n\n| Return ||\n|--------------------------------------------|------------------------------|\n| [ReadRecordsRequestUsingIds.Builder](#)\u003cT\u003e | This value cannot be `null`. |\n\n**See Also**\n\n- [android.health.connect.datatypes.Metadata](/reference/kotlin/android/health/connect/datatypes/Metadata)\n- [#addId(String)](#addId(kotlin.String)) \n\n### addId\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun addId(id: String): ReadRecordsRequestUsingIds.Builder\u003cT\u003e\n```\n\nAdd an UUID to the read request.\n\nThe maximum number of ids in a single [ReadRecordsRequestUsingIds](/reference/kotlin/android/health/connect/ReadRecordsRequestUsingIds) that Health Connect accepts is 5000. The limit includes all `id`s and `clientId`s.\n\n| Parameters ||\n|------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): Identifier generated by the platform and returned by [android.health.connect.HealthConnectManager#insertRecords](/reference/kotlin/android/health/connect/HealthConnectManager#insertRecords(kotlin.collections.MutableList,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)) This value cannot be `null`. |\n\n| Return ||\n|--------------------------------------------|------------------------------|\n| [ReadRecordsRequestUsingIds.Builder](#)\u003cT\u003e | This value cannot be `null`. |\n\n**See Also**\n\n- [#addClientRecordId(String)](#addClientRecordId(kotlin.String)) \n\n### build\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): ReadRecordsRequestUsingIds\u003cT\u003e\n```\n\nReturns Object of [ReadRecordsRequestUsingIds](/reference/kotlin/android/health/connect/ReadRecordsRequestUsingIds)\n\n| Return ||\n|------------------------------------------------------------------------------------------------------|------------------------------|\n| [ReadRecordsRequestUsingIds](/reference/kotlin/android/health/connect/ReadRecordsRequestUsingIds)\u003cT\u003e | This value cannot be `null`. |"]]