Builder
class Builder
kotlin.Any | |
↳ | android.health.connect.datatypes.MedicalResource.Builder |
Builder class for MedicalResource
.
Summary
Public constructors | |
---|---|
Builder(other: MedicalResource) Constructs a clone of the other |
|
Builder(other: MedicalResource.Builder) Constructs a clone of the other |
|
Builder(type: Int, dataSourceId: String, fhirVersion: FhirVersion, fhirResource: FhirResource) Constructs a new |
Public methods | |
---|---|
MedicalResource |
build() Returns a new instance of |
MedicalResource.Builder |
setDataSourceId(dataSourceId: String) Sets the unique |
MedicalResource.Builder |
setFhirResource(fhirResource: FhirResource) Sets the enclosed |
MedicalResource.Builder |
setFhirVersion(fhirVersion: FhirVersion) Sets the FHIR version being used for |
MedicalResource.Builder |
Sets the medical resource type. |
Public constructors
Builder
Builder(other: MedicalResource)
Constructs a clone of the other MedicalResource
instance.
Parameters | |
---|---|
other |
MedicalResource: This value cannot be null . |
Builder
Builder(other: MedicalResource.Builder)
Constructs a clone of the other MedicalResource.Builder
.
Parameters | |
---|---|
other |
MedicalResource.Builder: This value cannot be null . |
Builder
Builder(
type: Int,
dataSourceId: String,
fhirVersion: FhirVersion,
fhirResource: FhirResource)
Constructs a new MedicalResource.Builder
instance.
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the provided medical resource type is not a valid supported type, or dataSourceId is not a valid ID. |
Public methods
build
fun build(): MedicalResource
Returns a new instance of MedicalResource
with the specified parameters.
Return | |
---|---|
MedicalResource |
This value cannot be null . |
setDataSourceId
fun setDataSourceId(dataSourceId: String): MedicalResource.Builder
Sets the unique MedicalDataSource
ID of where the data comes from.
Parameters | |
---|---|
dataSourceId |
String: This value cannot be null . |
Return | |
---|---|
MedicalResource.Builder |
This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the provided dataSourceId is not a valid ID. |
setFhirResource
fun setFhirResource(fhirResource: FhirResource): MedicalResource.Builder
Sets the enclosed FhirResource
object.
Parameters | |
---|---|
fhirResource |
FhirResource: This value cannot be null . |
Return | |
---|---|
MedicalResource.Builder |
This value cannot be null . |
setFhirVersion
fun setFhirVersion(fhirVersion: FhirVersion): MedicalResource.Builder
Sets the FHIR version being used for fhirResource
.
Parameters | |
---|---|
fhirVersion |
FhirVersion: This value cannot be null . |
Return | |
---|---|
MedicalResource.Builder |
This value cannot be null . |
setType
fun setType(type: Int): MedicalResource.Builder
Sets the medical resource type.
Return | |
---|---|
MedicalResource.Builder |
This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the provided medical resource type is not a valid supported type. |