DeleteMedicalResourcesRequest.Builder


public static final class DeleteMedicalResourcesRequest.Builder
extends Object

java.lang.Object
   ↳ android.health.connect.DeleteMedicalResourcesRequest.Builder


Builder class for DeleteMedicalResourcesRequest.

Summary

Public constructors

Builder()

Constructs a new DeleteMedicalResourcesRequest.Builder with no filters.

Builder(DeleteMedicalResourcesRequest other)

Constructs a clone of the other DeleteMedicalResourcesRequest instance.

Builder(DeleteMedicalResourcesRequest.Builder other)

Constructs a clone of the other DeleteMedicalResourcesRequest.Builder.

Public methods

DeleteMedicalResourcesRequest.Builder addDataSourceId(String dataSourceId)

Adds the data source ID to request to delete.

DeleteMedicalResourcesRequest.Builder addMedicalResourceType(int resourceType)

Adds the medical resource type to request to delete.

DeleteMedicalResourcesRequest build()

Returns a new instance of DeleteMedicalResourcesRequest with the specified parameters.

DeleteMedicalResourcesRequest.Builder clearDataSourceIds()

Clears all data source IDs.

DeleteMedicalResourcesRequest.Builder clearMedicalResourceTypes()

Clears all medical resource types.

Inherited methods

Public constructors

Builder

public Builder ()

Constructs a new DeleteMedicalResourcesRequest.Builder with no filters.

Builder

public Builder (DeleteMedicalResourcesRequest other)

Constructs a clone of the other DeleteMedicalResourcesRequest instance.

Parameters
other DeleteMedicalResourcesRequest: This value cannot be null.

Builder

public Builder (DeleteMedicalResourcesRequest.Builder other)

Constructs a clone of the other DeleteMedicalResourcesRequest.Builder.

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

Public methods

addDataSourceId

public DeleteMedicalResourcesRequest.Builder addDataSourceId (String dataSourceId)

Adds the data source ID to request to delete. This should be an ID of the existing MedicalDataSource.

If the set of data source IDs is empty, it means resources from any data source should be deleted.

Parameters
dataSourceId String: This value cannot be null.

Returns
DeleteMedicalResourcesRequest.Builder This value cannot be null.

Throws
IllegalArgumentException if the provided dataSourceId is not a valid ID.

addMedicalResourceType

public DeleteMedicalResourcesRequest.Builder addMedicalResourceType (int resourceType)

Adds the medical resource type to request to delete.

Parameters
resourceType int: Value is MedicalResource.MEDICAL_RESOURCE_TYPE_ALLERGIES_INTOLERANCES, MedicalResource.MEDICAL_RESOURCE_TYPE_CONDITIONS, MedicalResource.MEDICAL_RESOURCE_TYPE_IMMUNIZATIONS, MedicalResource.MEDICAL_RESOURCE_TYPE_LABORATORY_RESULTS, MedicalResource.MEDICAL_RESOURCE_TYPE_MEDICATIONS, MedicalResource.MEDICAL_RESOURCE_TYPE_PERSONAL_DETAILS, MedicalResource.MEDICAL_RESOURCE_TYPE_PRACTITIONER_DETAILS, MedicalResource.MEDICAL_RESOURCE_TYPE_PREGNANCY, MedicalResource.MEDICAL_RESOURCE_TYPE_PROCEDURES, MedicalResource.MEDICAL_RESOURCE_TYPE_SOCIAL_HISTORY, MedicalResource.MEDICAL_RESOURCE_TYPE_VISITS, or MedicalResource.MEDICAL_RESOURCE_TYPE_VITAL_SIGNS

Returns
DeleteMedicalResourcesRequest.Builder This value cannot be null.

Throws
IllegalArgumentException if the provided resourceType is not supported.

build

public DeleteMedicalResourcesRequest build ()

Returns a new instance of DeleteMedicalResourcesRequest with the specified parameters.

Returns
DeleteMedicalResourcesRequest This value cannot be null.

Throws
IllegalArgumentException if no data source IDs or medical resource types have been added.

clearDataSourceIds

public DeleteMedicalResourcesRequest.Builder clearDataSourceIds ()

Clears all data source IDs.

Returns
DeleteMedicalResourcesRequest.Builder This value cannot be null.

clearMedicalResourceTypes

public DeleteMedicalResourcesRequest.Builder clearMedicalResourceTypes ()

Clears all medical resource types.

Returns
DeleteMedicalResourcesRequest.Builder This value cannot be null.