Builder
class Builder
| kotlin.Any | |
| ↳ | android.health.connect.datatypes.AlcoholConsumptionRecord.Builder |
Builder class for AlcoholConsumptionRecord
Summary
| Public constructors | |
|---|---|
|
Builder for an alcohol consumption record that occurs at a specific instant in time. |
|
|
Builder for an alcohol consumption record that occurs over a time interval. |
|
|
Builder for an alcohol consumption record that occurs on a specific date. |
|
| Public methods | |
|---|---|
| AlcoholConsumptionRecord |
build() |
| AlcoholConsumptionRecord.Builder |
Clears the zone offset of the user when the activity was logged. |
| AlcoholConsumptionRecord.Builder |
Clears the zone offset of the user when the activity was logged. |
| AlcoholConsumptionRecord.Builder |
setAlcoholByVolume(alcoholByVolume: Percentage?)Sets the alcohol by volume of the beverage. |
| AlcoholConsumptionRecord.Builder |
setBeverageType(beverageType: Int)Sets the type of beverage the user consumed. |
| AlcoholConsumptionRecord.Builder |
setEndZoneOffset(endZoneOffset: ZoneOffset)Sets the zone offset of the user when the activity was logged. |
| AlcoholConsumptionRecord.Builder |
setNotes(notes: CharSequence?)Sets the notes for this record. |
| AlcoholConsumptionRecord.Builder |
setServingVolume(servingVolume: Volume?)Sets the volume of a single serving consumed. |
| AlcoholConsumptionRecord.Builder |
setStartZoneOffset(startZoneOffset: ZoneOffset)Sets the zone offset of the user when the activity was logged. |
Public constructors
Builder
Builder(
metadata: Metadata,
time: Instant,
beverageType: Int)
Builder for an alcohol consumption record that occurs at a specific instant in time.
Builder
Builder(
metadata: Metadata,
startTime: Instant,
endTime: Instant,
beverageType: Int)
Builder for an alcohol consumption record that occurs over a time interval.
Builder
Builder(
metadata: Metadata,
date: LocalDate,
beverageType: Int)
Builder for an alcohol consumption record that occurs on a specific date.
Public methods
build
fun build(): AlcoholConsumptionRecord
| Return | |
|---|---|
AlcoholConsumptionRecord |
Object of AlcoholConsumptionRecord This value cannot be null. |
clearEndZoneOffset
fun clearEndZoneOffset(): AlcoholConsumptionRecord.Builder
Clears the zone offset of the user when the activity was logged.
| Return | |
|---|---|
AlcoholConsumptionRecord.Builder |
This value cannot be null. |
clearStartZoneOffset
fun clearStartZoneOffset(): AlcoholConsumptionRecord.Builder
Clears the zone offset of the user when the activity was logged.
| Return | |
|---|---|
AlcoholConsumptionRecord.Builder |
This value cannot be null. |
setAlcoholByVolume
fun setAlcoholByVolume(alcoholByVolume: Percentage?): AlcoholConsumptionRecord.Builder
Sets the alcohol by volume of the beverage.
| Parameters | |
|---|---|
alcoholByVolume |
Percentage?: The alcohol by volume. If provided, must be in the range 0.0 to 100.0. This value may be null. |
| Return | |
|---|---|
AlcoholConsumptionRecord.Builder |
This value cannot be null. |
setBeverageType
fun setBeverageType(beverageType: Int): AlcoholConsumptionRecord.Builder
Sets the type of beverage the user consumed.
| Return | |
|---|---|
AlcoholConsumptionRecord.Builder |
This value cannot be null. |
setEndZoneOffset
fun setEndZoneOffset(endZoneOffset: ZoneOffset): AlcoholConsumptionRecord.Builder
Sets the zone offset of the user when the activity was logged.
| Parameters | |
|---|---|
endZoneOffset |
ZoneOffset: This value cannot be null. |
| Return | |
|---|---|
AlcoholConsumptionRecord.Builder |
This value cannot be null. |
setNotes
fun setNotes(notes: CharSequence?): AlcoholConsumptionRecord.Builder
Sets the notes for this record.
| Parameters | |
|---|---|
notes |
CharSequence?: This value may be null. |
| Return | |
|---|---|
AlcoholConsumptionRecord.Builder |
This value cannot be null. |
setServingVolume
fun setServingVolume(servingVolume: Volume?): AlcoholConsumptionRecord.Builder
Sets the volume of a single serving consumed.
| Parameters | |
|---|---|
servingVolume |
Volume?: The volume of a single serving. If provided, must be positive and less than or equal to 255 liters. This value may be null. |
| Return | |
|---|---|
AlcoholConsumptionRecord.Builder |
This value cannot be null. |
setStartZoneOffset
fun setStartZoneOffset(startZoneOffset: ZoneOffset): AlcoholConsumptionRecord.Builder
Sets the zone offset of the user when the activity was logged.
| Parameters | |
|---|---|
startZoneOffset |
ZoneOffset: This value cannot be null. |
| Return | |
|---|---|
AlcoholConsumptionRecord.Builder |
This value cannot be null. |