Builder


class Builder
kotlin.Any
   ↳ android.health.connect.ReadMedicalResourcesInitialRequest.Builder

Builder class for ReadMedicalResourcesInitialRequest.

Summary

Public constructors

Constructs a clone of the other ReadMedicalResourcesInitialRequest instance.

Constructs a clone of the other ReadMedicalResourcesInitialRequest.Builder.

Builder(medicalResourceType: Int)

Constructs a new ReadMedicalResourcesInitialRequest.Builder instance.

Public methods
ReadMedicalResourcesInitialRequest.Builder
addDataSourceId(dataSourceId: String)

Adds the data source ID based on which the read operation is to be performed.

ReadMedicalResourcesInitialRequest.Builder

Adds all data source IDs based on which the read operation is to be performed.

ReadMedicalResourcesInitialRequest

Returns a new instance of ReadMedicalResourcesInitialRequest with the specified parameters.

ReadMedicalResourcesInitialRequest.Builder

Clears all the MedicalDataSource filters for this builder.

ReadMedicalResourcesInitialRequest.Builder
setMedicalResourceType(medicalResourceType: Int)

Sets the medical resource type.

ReadMedicalResourcesInitialRequest.Builder
setPageSize(pageSize: Int)

Sets the maximum number of MedicalResources to be returned by the read operation.

Public constructors

Builder

Builder(other: ReadMedicalResourcesInitialRequest)

Constructs a clone of the other ReadMedicalResourcesInitialRequest instance.

Parameters
other ReadMedicalResourcesInitialRequest: This value cannot be null.

Builder

Builder(other: ReadMedicalResourcesInitialRequest.Builder)

Constructs a clone of the other ReadMedicalResourcesInitialRequest.Builder.

Parameters
other ReadMedicalResourcesInitialRequest.Builder: This value cannot be null.

Public methods

addDataSourceId

fun addDataSourceId(dataSourceId: String): ReadMedicalResourcesInitialRequest.Builder

Adds the data source ID based on which the read operation is to be performed. This should be an ID of the existing MedicalDataSource.

If no MedicalDataSource ID is added, then MedicalResources from all MedicalDataSources will be read.

Parameters
dataSourceId String: This value cannot be null.
Return
ReadMedicalResourcesInitialRequest.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the provided dataSourceId is not a valid ID.

addDataSourceIds

fun addDataSourceIds(dataSourceIds: MutableSet<String!>): ReadMedicalResourcesInitialRequest.Builder

Adds all data source IDs based on which the read operation is to be performed. This should all be IDs of existing MedicalDataSources.

If no MedicalDataSource IDs are added, then MedicalResources from all MedicalDataSources will be read.

Parameters
dataSourceIds MutableSet<String!>: This value cannot be null.
Return
ReadMedicalResourcesInitialRequest.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the provided dataSourceIds is null, or any ID in it is not valid.

build

fun build(): ReadMedicalResourcesInitialRequest

Returns a new instance of ReadMedicalResourcesInitialRequest with the specified parameters.

Return
ReadMedicalResourcesInitialRequest This value cannot be null.

clearDataSourceIds

fun clearDataSourceIds(): ReadMedicalResourcesInitialRequest.Builder

Clears all the MedicalDataSource filters for this builder.

Return
ReadMedicalResourcesInitialRequest.Builder This value cannot be null.

setPageSize

fun setPageSize(pageSize: Int): ReadMedicalResourcesInitialRequest.Builder

Sets the maximum number of MedicalResources to be returned by the read operation.

If not set, default to 1000.

Parameters
pageSize Int: Value is between MINIMUM_PAGE_SIZE and MAXIMUM_PAGE_SIZE inclusive
Return
ReadMedicalResourcesInitialRequest.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the provided pageSize is less than 1 or more than 5000.