AlcoholConsumptionRecord
public
class
AlcoholConsumptionRecord
extends IntervalRecord
| java.lang.Object | |||
| ↳ | 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 | |
|---|---|
class |
AlcoholConsumptionRecord.Builder
Builder class for |
Public methods | |
|---|---|
boolean
|
equals(Object o)
Indicates whether some other object is "equal to" this one. |
Percentage
|
getAlcoholByVolume()
Returns the alcohol by volume of the beverage or |
int
|
getBeverageType()
Returns the type of beverage the user consumed. |
LocalDate
|
getDate()
Returns the date of the record, or |
CharSequence
|
getNotes()
Returns the notes for this record. |
Volume
|
getServingVolume()
Returns the volume of each serving consumed. |
int
|
getTemporalType()
Returns the temporal type of this record, indicating whether it represents an instant, an interval, or a local date. |
int
|
hashCode()
Returns a hash code value for the object. |
Inherited methods | |
|---|---|
Constants
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_ABSINTHE
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_ABSINTHE
Use this type for absinthe.
Constant Value: 14 (0x0000000e)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BEER
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BEER
Use this type for beer.
Constant Value: 1 (0x00000001)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BRANDY
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BRANDY
Use this type for brandy.
Constant Value: 15 (0x0000000f)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CHUHAI
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CHUHAI
Use this type for chuhai.
Constant Value: 17 (0x00000011)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CIDER
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CIDER
Use this type for cider.
Constant Value: 9 (0x00000009)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_COCKTAIL
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_COCKTAIL
Use this type for cocktail.
Constant Value: 16 (0x00000010)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_GIN
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_GIN
Use this type for gin.
Constant Value: 4 (0x00000004)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_HIGHBALL
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_HIGHBALL
Use this type for highball.
Constant Value: 18 (0x00000012)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_LAGER
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_LAGER
Use this type for lager.
Constant Value: 8 (0x00000008)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_MEAD
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_MEAD
Use this type for mead.
Constant Value: 13 (0x0000000d)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_OTHER
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_OTHER
Use this type for other beverage types.
Constant Value: 0 (0x00000000)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_RUM
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_RUM
Use this type for rum.
Constant Value: 6 (0x00000006)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SAKE
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SAKE
Use this type for sake.
Constant Value: 10 (0x0000000a)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SHOCHU
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SHOCHU
Use this type for shochu.
Constant Value: 11 (0x0000000b)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SOJU
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SOJU
Use this type for soju.
Constant Value: 12 (0x0000000c)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_TEQUILA
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_TEQUILA
Use this type for tequila.
Constant Value: 7 (0x00000007)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_VODKA
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_VODKA
Use this type for vodka.
Constant Value: 3 (0x00000003)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WHISKEY
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WHISKEY
Use this type for whiskey.
Constant Value: 5 (0x00000005)
ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WINE
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WINE
Use this type for wine.
Constant Value: 2 (0x00000002)
RECORD_TEMPORAL_TYPE_INSTANT
public static final int RECORD_TEMPORAL_TYPE_INSTANT
The record represents an instantaneous event.
Constant Value: 0 (0x00000000)
RECORD_TEMPORAL_TYPE_INTERVAL
public static final int RECORD_TEMPORAL_TYPE_INTERVAL
The record represents an event over an interval.
Constant Value: 1 (0x00000001)
RECORD_TEMPORAL_TYPE_LOCAL_DATE
public static final int RECORD_TEMPORAL_TYPE_LOCAL_DATE
The record represents an event that occurred on a specific date.
Constant Value: 2 (0x00000002)
Public methods
equals
public boolean equals (Object o)
Indicates whether some other object is "equal to" this one.
| Parameters | |
|---|---|
o |
Object: the reference object with which to compare.
This value may be null. |
| Returns | |
|---|---|
boolean |
true if this object is the same as the other object |
getAlcoholByVolume
public Percentage getAlcoholByVolume ()
Returns the alcohol by volume of the beverage or null if alcohol by volume is null.
| Returns | |
|---|---|
Percentage |
|
getBeverageType
public int getBeverageType ()
Returns the type of beverage the user consumed.
getDate
public LocalDate getDate ()
Returns the date of the record, or null if the record is not a local date record.
| Returns | |
|---|---|
LocalDate |
|
getNotes
public CharSequence getNotes ()
Returns the notes for this record. Returns null if no notes were specified.
| Returns | |
|---|---|
CharSequence |
|
getServingVolume
public Volume getServingVolume ()
Returns the volume of each serving consumed. Returns null if no serving volume was
specified.
| Returns | |
|---|---|
Volume |
|
getTemporalType
public int getTemporalType ()
Returns the temporal type of this record, indicating whether it represents an instant, an interval, or a local date.
| Returns | |
|---|---|
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
public int hashCode ()
Returns a hash code value for the object.
| Returns | |
|---|---|
int |
a hash code value for this object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-13 UTC.