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 AlcoholConsumptionRecord 

Constants

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_ABSINTHE

Use this type for absinthe.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BEER

Use this type for beer.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BRANDY

Use this type for brandy.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CHUHAI

Use this type for chuhai.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CIDER

Use this type for cider.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_COCKTAIL

Use this type for cocktail.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_GIN

Use this type for gin.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_HIGHBALL

Use this type for highball.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_LAGER

Use this type for lager.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_MEAD

Use this type for mead.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_OTHER

Use this type for other beverage types.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_RUM

Use this type for rum.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SAKE

Use this type for sake.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SHOCHU

Use this type for shochu.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SOJU

Use this type for soju.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_TEQUILA

Use this type for tequila.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_VODKA

Use this type for vodka.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WHISKEY

Use this type for whiskey.

int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WINE

Use this type for wine.

int RECORD_TEMPORAL_TYPE_INSTANT

The record represents an instantaneous event.

int RECORD_TEMPORAL_TYPE_INTERVAL

The record represents an event over an interval.

int RECORD_TEMPORAL_TYPE_LOCAL_DATE

The record represents an event that occurred on a specific date.

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 null if alcohol by volume is null.

int getBeverageType()

Returns the type of beverage the user consumed.

LocalDate getDate()

Returns the date of the record, or null if the record is not a local date record.

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

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_ABSINTHE

Use this type for absinthe.

Constant Value: 14 (0x0000000e)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BEER

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BEER

Use this type for beer.

Constant Value: 1 (0x00000001)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BRANDY

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BRANDY

Use this type for brandy.

Constant Value: 15 (0x0000000f)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CHUHAI

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CHUHAI

Use this type for chuhai.

Constant Value: 17 (0x00000011)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CIDER

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CIDER

Use this type for cider.

Constant Value: 9 (0x00000009)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_COCKTAIL

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_COCKTAIL

Use this type for cocktail.

Constant Value: 16 (0x00000010)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_GIN

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_GIN

Use this type for gin.

Constant Value: 4 (0x00000004)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_HIGHBALL

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_HIGHBALL

Use this type for highball.

Constant Value: 18 (0x00000012)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_LAGER

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_LAGER

Use this type for lager.

Constant Value: 8 (0x00000008)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_MEAD

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_MEAD

Use this type for mead.

Constant Value: 13 (0x0000000d)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_OTHER

Added in U Extensions 21
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

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_RUM

Use this type for rum.

Constant Value: 6 (0x00000006)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SAKE

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SAKE

Use this type for sake.

Constant Value: 10 (0x0000000a)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SHOCHU

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SHOCHU

Use this type for shochu.

Constant Value: 11 (0x0000000b)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SOJU

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SOJU

Use this type for soju.

Constant Value: 12 (0x0000000c)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_TEQUILA

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_TEQUILA

Use this type for tequila.

Constant Value: 7 (0x00000007)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_VODKA

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_VODKA

Use this type for vodka.

Constant Value: 3 (0x00000003)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WHISKEY

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WHISKEY

Use this type for whiskey.

Constant Value: 5 (0x00000005)

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WINE

Added in U Extensions 21
public static final int ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WINE

Use this type for wine.

Constant Value: 2 (0x00000002)

RECORD_TEMPORAL_TYPE_INSTANT

Added in U Extensions 21
public static final int RECORD_TEMPORAL_TYPE_INSTANT

The record represents an instantaneous event.

Constant Value: 0 (0x00000000)

RECORD_TEMPORAL_TYPE_INTERVAL

Added in U Extensions 21
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

Added in U Extensions 21
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

Added in U Extensions 21
public Percentage getAlcoholByVolume ()

Returns the alcohol by volume of the beverage or null if alcohol by volume is null.

Returns
Percentage

getBeverageType

Added in U Extensions 21
public int getBeverageType ()

Returns the type of beverage the user consumed.

Returns
int Value is one of the following:

getDate

Added in U Extensions 21
public LocalDate getDate ()

Returns the date of the record, or null if the record is not a local date record.

Returns
LocalDate

getNotes

Added in U Extensions 21
public CharSequence getNotes ()

Returns the notes for this record. Returns null if no notes were specified.

Returns
CharSequence

getServingVolume

Added in U Extensions 21
public Volume getServingVolume ()

Returns the volume of each serving consumed. Returns null if no serving volume was specified.

Returns
Volume

getTemporalType

Added in U Extensions 21
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.