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
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.
Builder
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.
Builder
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.
Public methods
build
public SymptomRecord build ()
| Returns | |
|---|---|
SymptomRecord |
A SymptomRecord with the specified parameters.
This value cannot be null. |
setCount
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
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
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
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
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. |