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 ReadMedicalResourcesInitialRequest instance.

Builder(ReadMedicalResourcesInitialRequest.Builder other)

Constructs a clone of the other ReadMedicalResourcesInitialRequest.Builder.

Builder(int medicalResourceType)

Constructs a new ReadMedicalResourcesInitialRequest.Builder instance.

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 with the specified parameters.

ReadMedicalResourcesInitialRequest.Builder clearDataSourceIds()

Clears all the MedicalDataSource filters for this builder.

ReadMedicalResourcesInitialRequest.Builder setMedicalResourceType(int medicalResourceType)

Sets the medical resource type.

ReadMedicalResourcesInitialRequest.Builder setPageSize(int pageSize)

Sets the maximum number of MedicalResources to be returned by the read operation.

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 (ReadMedicalResourcesInitialRequest other)

Constructs a clone of the other ReadMedicalResourcesInitialRequest instance.

Parameters
other ReadMedicalResourcesInitialRequest: This value cannot be null.

Builder

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

Constructs a clone of the other ReadMedicalResourcesInitialRequest.Builder.

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

Builder

Added in U Extensions 16
public Builder (int medicalResourceType)

Constructs a new ReadMedicalResourcesInitialRequest.Builder instance.

Throws
IllegalArgumentException if the provided medicalResourceType is not a supported type.

Public methods

addDataSourceId

Added in U Extensions 16
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 be null.

Returns
ReadMedicalResourcesInitialRequest.Builder This value cannot be null.

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

addDataSourceIds

Added in U Extensions 16
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 be null.

Returns
ReadMedicalResourcesInitialRequest.Builder This value cannot be null.

Throws
IllegalArgumentException if the provided dataSourceIds is null, or any ID in it is not valid.

build

Added in U Extensions 16
public ReadMedicalResourcesInitialRequest build ()

Returns a new instance of ReadMedicalResourcesInitialRequest with the specified parameters.

Returns
ReadMedicalResourcesInitialRequest This value cannot be null.

clearDataSourceIds

Added in U Extensions 16
public ReadMedicalResourcesInitialRequest.Builder clearDataSourceIds ()

Clears all the MedicalDataSource filters for this builder.

Returns
ReadMedicalResourcesInitialRequest.Builder This value cannot be null.

setMedicalResourceType

Added in U Extensions 16
public ReadMedicalResourcesInitialRequest.Builder setMedicalResourceType (int medicalResourceType)

Sets the medical resource type.

Returns
ReadMedicalResourcesInitialRequest.Builder This value cannot be null.

Throws
IllegalArgumentException if the provided medicalResourceType is not a supported type.

setPageSize

Added in U Extensions 16
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 between MINIMUM_PAGE_SIZE and MAXIMUM_PAGE_SIZE inclusive

Returns
ReadMedicalResourcesInitialRequest.Builder This value cannot be null.

Throws
IllegalArgumentException if the provided pageSize is less than 1 or more than 5000.