UpsertMedicalResourceRequest.Builder


public static final class UpsertMedicalResourceRequest.Builder
extends Object

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


Builder class for UpsertMedicalResourceRequest.

Summary

Public constructors

Builder(UpsertMedicalResourceRequest other)

Constructs a clone of the other UpsertMedicalResourceRequest instance.

Builder(UpsertMedicalResourceRequest.Builder other)

Constructs a clone of the other UpsertMedicalResourceRequest.Builder.

Builder(String dataSourceId, FhirVersion fhirVersion, String data)

Constructs a new UpsertMedicalResourceRequest.Builder instance.

Public methods

UpsertMedicalResourceRequest build()

Returns a new instance of UpsertMedicalResourceRequest with the specified parameters.

UpsertMedicalResourceRequest.Builder setData(String data)

Sets the FHIR resource data in JSON format.

UpsertMedicalResourceRequest.Builder setDataSourceId(String dataSourceId)

Sets the unique ID of the existing MedicalDataSource, to represent where the data is coming from.

UpsertMedicalResourceRequest.Builder setFhirVersion(FhirVersion fhirVersion)

Sets the FHIR version being used for data.

Inherited methods

Public constructors

Builder

public Builder (UpsertMedicalResourceRequest other)

Constructs a clone of the other UpsertMedicalResourceRequest instance.

Parameters
other UpsertMedicalResourceRequest: This value cannot be null.

Builder

public Builder (UpsertMedicalResourceRequest.Builder other)

Constructs a clone of the other UpsertMedicalResourceRequest.Builder.

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

Builder

public Builder (String dataSourceId, 
                FhirVersion fhirVersion, 
                String data)

Constructs a new UpsertMedicalResourceRequest.Builder instance.

Parameters
dataSourceId String: The unique identifier of the existing MedicalDataSource, representing where the data comes from. This value cannot be null.

fhirVersion FhirVersion: The FhirVersion object that represents the FHIR version being used for data. This has to match the FHIR version of the MedicalDataSource. This value cannot be null.

data String: The FHIR resource data in JSON representation. This value cannot be null.

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

Public methods

build

public UpsertMedicalResourceRequest build ()

Returns a new instance of UpsertMedicalResourceRequest with the specified parameters.

Returns
UpsertMedicalResourceRequest This value cannot be null.

setData

public UpsertMedicalResourceRequest.Builder setData (String data)

Sets the FHIR resource data in JSON format.

Parameters
data String: This value cannot be null.

Returns
UpsertMedicalResourceRequest.Builder This value cannot be null.

setDataSourceId

public UpsertMedicalResourceRequest.Builder setDataSourceId (String dataSourceId)

Sets the unique ID of the existing MedicalDataSource, to represent where the data is coming from.

Parameters
dataSourceId String: This value cannot be null.

Returns
UpsertMedicalResourceRequest.Builder This value cannot be null.

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

setFhirVersion

public UpsertMedicalResourceRequest.Builder setFhirVersion (FhirVersion fhirVersion)

Sets the FHIR version being used for data. For the request to succeed this must match the MedicalDataSource.getFhirVersion() FHIR version} of the MedicalDataSource with the provided dataSourceId.

Parameters
fhirVersion FhirVersion: This value cannot be null.

Returns
UpsertMedicalResourceRequest.Builder This value cannot be null.