ReadMedicalResourcesInitialRequest.Builder
  public
  static
  final
  
  class
  ReadMedicalResourcesInitialRequest.Builder
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.health.connect.ReadMedicalResourcesInitialRequest.Builder | 
Builder class for ReadMedicalResourcesInitialRequest.
Summary
| Public constructors | |
|---|---|
| 
      Builder(ReadMedicalResourcesInitialRequest other)
      Constructs a clone of the other  | |
| 
      Builder(ReadMedicalResourcesInitialRequest.Builder other)
      Constructs a clone of the other  | |
| 
      Builder(int medicalResourceType)
      Constructs a new  | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        ReadMedicalResourcesInitialRequest.Builder | 
      addDataSourceId(String dataSourceId)
      Adds the data source ID based on which the read operation is to be performed. | 
| 
        
        
        
        
        
        ReadMedicalResourcesInitialRequest.Builder | 
      addDataSourceIds(Set<String> dataSourceIds)
      Adds all data source IDs based on which the read operation is to be performed. | 
| 
        
        
        
        
        
        ReadMedicalResourcesInitialRequest | 
      build()
      Returns a new instance of  | 
| 
        
        
        
        
        
        ReadMedicalResourcesInitialRequest.Builder | 
      clearDataSourceIds()
      Clears all the  | 
| 
        
        
        
        
        
        ReadMedicalResourcesInitialRequest.Builder | 
      setMedicalResourceType(int medicalResourceType)
      Sets the medical resource type. | 
| 
        
        
        
        
        
        ReadMedicalResourcesInitialRequest.Builder | 
      setPageSize(int pageSize)
      Sets the maximum number of  | 
| Inherited methods | |
|---|---|
Public constructors
Builder
public Builder (ReadMedicalResourcesInitialRequest other)
Constructs a clone of the other ReadMedicalResourcesInitialRequest instance.
| Parameters | |
|---|---|
| other | ReadMedicalResourcesInitialRequest: This value cannot benull. | 
Builder
public Builder (ReadMedicalResourcesInitialRequest.Builder other)
Constructs a clone of the other ReadMedicalResourcesInitialRequest.Builder.
| Parameters | |
|---|---|
| other | ReadMedicalResourcesInitialRequest.Builder: This value cannot benull. | 
Builder
public Builder (int medicalResourceType)
Constructs a new ReadMedicalResourcesInitialRequest.Builder instance.
| Parameters | |
|---|---|
| medicalResourceType | int: The medical resource type.
 Value isMedicalResource.MEDICAL_RESOURCE_TYPE_ALLERGIES_INTOLERANCES,MedicalResource.MEDICAL_RESOURCE_TYPE_CONDITIONS,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_VACCINES,MedicalResource.MEDICAL_RESOURCE_TYPE_VISITS,MedicalResource.MEDICAL_RESOURCE_TYPE_VITAL_SIGNS, or android.health.connect.datatypes.MedicalResource.MEDICAL_RESOURCE_TYPE_DEVICES | 
| Throws | |
|---|---|
| IllegalArgumentException | if the provided medicalResourceTypeis not a
     supported type. | 
Public methods
addDataSourceId
public ReadMedicalResourcesInitialRequest.Builder addDataSourceId (String dataSourceId)
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 benull. | 
| Returns | |
|---|---|
| ReadMedicalResourcesInitialRequest.Builder | This value cannot be null. | 
| Throws | |
|---|---|
| IllegalArgumentException | if the provided dataSourceIdis not a valid ID. | 
addDataSourceIds
public ReadMedicalResourcesInitialRequest.Builder addDataSourceIds (Set<String> dataSourceIds)
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 | Set: This value cannot benull. | 
| Returns | |
|---|---|
| ReadMedicalResourcesInitialRequest.Builder | This value cannot be null. | 
| Throws | |
|---|---|
| IllegalArgumentException | if the provided dataSourceIdsis null, or any ID
     in it is not valid. | 
build
public ReadMedicalResourcesInitialRequest build ()
Returns a new instance of ReadMedicalResourcesInitialRequest with the specified
 parameters.
| Returns | |
|---|---|
| ReadMedicalResourcesInitialRequest | This value cannot be null. | 
clearDataSourceIds
public ReadMedicalResourcesInitialRequest.Builder clearDataSourceIds ()
Clears all the MedicalDataSource filters for this builder.
| Returns | |
|---|---|
| ReadMedicalResourcesInitialRequest.Builder | This value cannot be null. | 
setMedicalResourceType
public ReadMedicalResourcesInitialRequest.Builder setMedicalResourceType (int medicalResourceType)
Sets the medical resource type.
| Returns | |
|---|---|
| ReadMedicalResourcesInitialRequest.Builder | This value cannot be null. | 
| Throws | |
|---|---|
| IllegalArgumentException | if the provided medicalResourceTypeis not a
     supported type. | 
setPageSize
public ReadMedicalResourcesInitialRequest.Builder setPageSize (int pageSize)
Sets the maximum number of MedicalResources to be returned by the read operation.
 
If not set, default to 1000.
| Parameters | |
|---|---|
| pageSize | int: Value is betweenERROR(/android.health.connect.Constants#MINIMUM_PAGE_SIZE)andERROR(/android.health.connect.Constants#MAXIMUM_PAGE_SIZE)inclusive | 
| Returns | |
|---|---|
| ReadMedicalResourcesInitialRequest.Builder | This value cannot be null. | 
| Throws | |
|---|---|
| IllegalArgumentException | if the provided pageSizeis less than 1 or more
     than 5000. | 
