AlcoholConsumptionRecord
open class AlcoholConsumptionRecord : IntervalRecord
| kotlin.Any | |||
| ↳ | android.health.connect.datatypes.Record | ||
| ↳ | android.health.connect.datatypes.IntervalRecord | ||
| ↳ | android.health.connect.datatypes.AlcoholConsumptionRecord | ||
Captures a user's alcohol consumption. Each record represents one or more servings of an alcoholic beverage, consumed either at an instant, over an interval of time, or on a specific day.
Summary
| Nested classes | |
|---|---|
|
Builder class for |
|
| Constants | |
|---|---|
| static Int |
Use this type for absinthe. |
| static Int |
Use this type for beer. |
| static Int |
Use this type for brandy. |
| static Int |
Use this type for chuhai. |
| static Int |
Use this type for cider. |
| static Int |
Use this type for cocktail. |
| static Int |
Use this type for gin. |
| static Int |
Use this type for highball. |
| static Int |
Use this type for lager. |
| static Int |
Use this type for mead. |
| static Int |
Use this type for other beverage types. |
| static Int |
Use this type for rum. |
| static Int |
Use this type for sake. |
| static Int |
Use this type for shochu. |
| static Int |
Use this type for soju. |
| static Int |
Use this type for tequila. |
| static Int |
Use this type for vodka. |
| static Int |
Use this type for whiskey. |
| static Int |
Use this type for wine. |
| static Int |
The record represents an instantaneous event. |
| static Int |
The record represents an event over an interval. |
| static Int |
The record represents an event that occurred on a specific date. |
| Public methods | |
|---|---|
| open Boolean |
Indicates whether some other object is "equal to" this one. |
| open Percentage? |
Returns the alcohol by volume of the beverage or |
| open Int |
Returns the type of beverage the user consumed. |
| open LocalDate? |
getDate()Returns the date of the record, or |
| open CharSequence? |
getNotes()Returns the notes for this record. |
| open Volume? |
Returns the volume of each serving consumed. |
| open Int |
Returns the temporal type of this record, indicating whether it represents an instant, an interval, or a local date. |
| open Int |
hashCode()Returns a hash code value for the object. |
| Inherited functions | |
|---|---|
Constants
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_ABSINTHE
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_ABSINTHE: Int
Use this type for absinthe.
Value: 14ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BEER
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BEER: Int
Use this type for beer.
Value: 1ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BRANDY
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BRANDY: Int
Use this type for brandy.
Value: 15ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CHUHAI
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CHUHAI: Int
Use this type for chuhai.
Value: 17ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CIDER
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CIDER: Int
Use this type for cider.
Value: 9ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_COCKTAIL
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_COCKTAIL: Int
Use this type for cocktail.
Value: 16ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_GIN
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_GIN: Int
Use this type for gin.
Value: 4ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_HIGHBALL
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_HIGHBALL: Int
Use this type for highball.
Value: 18ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_LAGER
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_LAGER: Int
Use this type for lager.
Value: 8ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_MEAD
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_MEAD: Int
Use this type for mead.
Value: 13ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_OTHER
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_OTHER: Int
Use this type for other beverage types.
Value: 0ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_RUM
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_RUM: Int
Use this type for rum.
Value: 6ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SAKE
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SAKE: Int
Use this type for sake.
Value: 10ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SHOCHU
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SHOCHU: Int
Use this type for shochu.
Value: 11ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SOJU
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SOJU: Int
Use this type for soju.
Value: 12ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_TEQUILA
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_TEQUILA: Int
Use this type for tequila.
Value: 7ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_VODKA
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_VODKA: Int
Use this type for vodka.
Value: 3ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WHISKEY
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WHISKEY: Int
Use this type for whiskey.
Value: 5ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WINE
static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WINE: Int
Use this type for wine.
Value: 2RECORD_TEMPORAL_TYPE_INSTANT
static val RECORD_TEMPORAL_TYPE_INSTANT: Int
The record represents an instantaneous event.
Value: 0RECORD_TEMPORAL_TYPE_INTERVAL
static val RECORD_TEMPORAL_TYPE_INTERVAL: Int
The record represents an event over an interval.
Value: 1RECORD_TEMPORAL_TYPE_LOCAL_DATE
static val RECORD_TEMPORAL_TYPE_LOCAL_DATE: Int
The record represents an event that occurred on a specific date.
Value: 2Public methods
equals
open fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
object |
the reference object with which to compare. This value may be null. |
o |
the reference object with which to compare. This value may be null. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the other object |
getAlcoholByVolume
open fun getAlcoholByVolume(): Percentage?
Returns the alcohol by volume of the beverage or null if alcohol by volume is null.
getBeverageType
open fun getBeverageType(): Int
Returns the type of beverage the user consumed.
getDate
open fun getDate(): LocalDate?
Returns the date of the record, or null if the record is not a local date record.
getNotes
open fun getNotes(): CharSequence?
Returns the notes for this record. Returns null if no notes were specified.
getServingVolume
open fun getServingVolume(): Volume?
Returns the volume of each serving consumed. Returns null if no serving volume was specified.
getTemporalType
open fun getTemporalType(): Int
Returns the temporal type of this record, indicating whether it represents an instant, an interval, or a local date.
| Return | |
|---|---|
Int |
The temporal type, as one of RECORD_TEMPORAL_TYPE_INSTANT, RECORD_TEMPORAL_TYPE_INTERVAL, or RECORD_TEMPORAL_TYPE_LOCAL_DATE. Value is one of the following: |
hashCode
open fun hashCode(): Int
Returns a hash code value for the object.
| Return | |
|---|---|
Int |
a hash code value for this object. |