SymptomRecord.Builder


public static final class SymptomRecord.Builder
extends Object

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


Builder class for SymptomRecord.

Summary

Public constructors

Builder(int symptomType, Instant time, Metadata metadata)

Builder for a symptom that occurs at a specific instant time.

Builder(int symptomType, Instant startTime, Instant endTime, Metadata metadata)

Builder for a symptom that occurs over a time interval.

Builder(int symptomType, LocalDate date, Metadata metadata)

Builder for a symptom that falls on a specific local date.

Public methods

SymptomRecord build()
SymptomRecord.Builder setCount(int count)

Sets the number of occurrences of the symptom for this record.

SymptomRecord.Builder setEndZoneOffset(ZoneOffset endZoneOffset)

Sets the end zone offset of this record.

SymptomRecord.Builder setNotes(String notes)

Sets the notes for this record.

SymptomRecord.Builder setSeverity(int severity)

Sets the severity of the symptom for this record.

SymptomRecord.Builder setStartZoneOffset(ZoneOffset startZoneOffset)

Sets the start zone offset of this record.

Inherited methods

Public constructors

Builder

Added in U Extensions 21
public Builder (int symptomType, 
                Instant time, 
                Metadata metadata)

Builder for a symptom that occurs at a specific instant time. The temporal type of the record will be set to SymptomRecord.RECORD_TEMPORAL_TYPE_INSTANT.

Parameters
symptomType int: The type of symptom.
Value is one of the following:
time Instant: The time of the record.
This value cannot be null.
metadata Metadata: The metadata of the record.
This value cannot be null.

Builder

Added in U Extensions 21
public Builder (int symptomType, 
                Instant startTime, 
                Instant endTime, 
                Metadata metadata)

Builder for a symptom that occurs over a time interval. The temporal type of the record will be set to SymptomRecord.RECORD_TEMPORAL_TYPE_INTERVAL.

Parameters
symptomType int: The type of symptom.
Value is one of the following:
startTime Instant: The start time of the record.
This value cannot be null.
endTime Instant: The end time of the record.
This value cannot be null.
metadata Metadata: The metadata of the record.
This value cannot be null.

Builder

Added in U Extensions 21
public Builder (int symptomType, 
                LocalDate date, 
                Metadata metadata)

Builder for a symptom that falls on a specific local date. The temporal type of the record will be set to SymptomRecord.RECORD_TEMPORAL_TYPE_LOCAL_DATE.

Parameters
symptomType int: The type of symptom.
Value is one of the following:
date LocalDate: The date of the record.
This value cannot be null.
metadata Metadata: The metadata of the record.
This value cannot be null.

Public methods

build

Added in U Extensions 21
public SymptomRecord build ()

Returns
SymptomRecord A SymptomRecord with the specified parameters.
This value cannot be null.

setCount

Added in U Extensions 21
public SymptomRecord.Builder setCount (int count)

Sets the number of occurrences of the symptom for this record.

Parameters
count int: The number of occurrences of the symptom.
Returns
SymptomRecord.Builder This builder.
This value cannot be null.
Throws
IllegalStateException if the builder is for an instant record.

setEndZoneOffset

Added in U Extensions 21
public SymptomRecord.Builder setEndZoneOffset (ZoneOffset endZoneOffset)

Sets the end zone offset of this record.

Parameters
endZoneOffset ZoneOffset: The end zone offset of the record.
This value cannot be null.
Returns
SymptomRecord.Builder This builder.
This value cannot be null.
Throws
IllegalStateException if the builder is for a local date record.

setNotes

Added in U Extensions 21
public SymptomRecord.Builder setNotes (String notes)

Sets the notes for this record.

Parameters
notes String: A description of the symptom.
This value may be null.
Returns
SymptomRecord.Builder This builder.
This value cannot be null.

setSeverity

Added in U Extensions 21
public SymptomRecord.Builder setSeverity (int severity)

Sets the severity of the symptom for this record.

Parameters
severity int: The severity of the symptom.
Value is one of the following:
Returns
SymptomRecord.Builder This builder.
This value cannot be null.

setStartZoneOffset

Added in U Extensions 21
public SymptomRecord.Builder setStartZoneOffset (ZoneOffset startZoneOffset)

Sets the start zone offset of this record.

Parameters
startZoneOffset ZoneOffset: The start zone offset of the record.
This value cannot be null.
Returns
SymptomRecord.Builder This builder.
This value cannot be null.
Throws
IllegalStateException if the builder is for a local date record.