MedicalResource.Builder


public static final class MedicalResource.Builder
extends Object

java.lang.Object
   ↳ android.health.connect.datatypes.MedicalResource.Builder


Builder class for MedicalResource.

Summary

Public constructors

Builder(MedicalResource other)

Constructs a clone of the other MedicalResource instance.

Builder(MedicalResource.Builder other)

Constructs a clone of the other MedicalResource.Builder.

Builder(int type, String dataSourceId, FhirVersion fhirVersion, FhirResource fhirResource)

Constructs a new MedicalResource.Builder instance.

Public methods

MedicalResource build()

Returns a new instance of MedicalResource with the specified parameters.

MedicalResource.Builder setDataSourceId(String dataSourceId)

Sets the unique MedicalDataSource ID of where the data comes from.

MedicalResource.Builder setFhirResource(FhirResource fhirResource)

Sets the enclosed FhirResource object.

MedicalResource.Builder setFhirVersion(FhirVersion fhirVersion)

Sets the FHIR version being used for fhirResource.

MedicalResource.Builder setType(int type)

Sets the medical resource type.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in U Extensions 16
public Builder (MedicalResource other)

Constructs a clone of the other MedicalResource instance.

Parameters
other MedicalResource: This value cannot be null.

Builder

Added in U Extensions 16
public Builder (MedicalResource.Builder other)

Constructs a clone of the other MedicalResource.Builder.

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

Builder

Added in U Extensions 16
public Builder (int type, 
                String dataSourceId, 
                FhirVersion fhirVersion, 
                FhirResource fhirResource)

Constructs a new MedicalResource.Builder instance.

Throws
IllegalArgumentException if the provided medical resource type is not a valid supported type, or dataSourceId is not a valid ID.

Public methods

build

Added in U Extensions 16
public MedicalResource build ()

Returns a new instance of MedicalResource with the specified parameters.

Returns
MedicalResource This value cannot be null.

setDataSourceId

Added in U Extensions 16
public MedicalResource.Builder setDataSourceId (String dataSourceId)

Sets the unique MedicalDataSource ID of where the data comes from.

Parameters
dataSourceId String: This value cannot be null.

Returns
MedicalResource.Builder This value cannot be null.

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

setFhirResource

Added in U Extensions 16
public MedicalResource.Builder setFhirResource (FhirResource fhirResource)

Sets the enclosed FhirResource object.

Parameters
fhirResource FhirResource: This value cannot be null.

Returns
MedicalResource.Builder This value cannot be null.

setFhirVersion

Added in U Extensions 16
public MedicalResource.Builder setFhirVersion (FhirVersion fhirVersion)

Sets the FHIR version being used for fhirResource.

Parameters
fhirVersion FhirVersion: This value cannot be null.

Returns
MedicalResource.Builder This value cannot be null.

setType

Added in U Extensions 16
public MedicalResource.Builder setType (int type)

Sets the medical resource type.

Returns
MedicalResource.Builder This value cannot be null.

Throws
IllegalArgumentException if the provided medical resource type is not a valid supported type.