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 AlcoholConsumptionRecord

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
equals(other: Any?)

Indicates whether some other object is "equal to" this one.

open Percentage?

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

open Int

Returns the type of beverage the user consumed.

open LocalDate?

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

open CharSequence?

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

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: 14

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BEER

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BEER: Int

Use this type for beer.

Value: 1

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BRANDY

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_BRANDY: Int

Use this type for brandy.

Value: 15

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CHUHAI

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CHUHAI: Int

Use this type for chuhai.

Value: 17

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CIDER

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_CIDER: Int

Use this type for cider.

Value: 9

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_COCKTAIL

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_COCKTAIL: Int

Use this type for cocktail.

Value: 16

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_GIN

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_GIN: Int

Use this type for gin.

Value: 4

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_HIGHBALL

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_HIGHBALL: Int

Use this type for highball.

Value: 18

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_LAGER

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_LAGER: Int

Use this type for lager.

Value: 8

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_MEAD

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_MEAD: Int

Use this type for mead.

Value: 13

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_OTHER

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_OTHER: Int

Use this type for other beverage types.

Value: 0

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_RUM

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_RUM: Int

Use this type for rum.

Value: 6

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SAKE

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SAKE: Int

Use this type for sake.

Value: 10

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SHOCHU

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SHOCHU: Int

Use this type for shochu.

Value: 11

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SOJU

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_SOJU: Int

Use this type for soju.

Value: 12

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_TEQUILA

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_TEQUILA: Int

Use this type for tequila.

Value: 7

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_VODKA

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_VODKA: Int

Use this type for vodka.

Value: 3

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WHISKEY

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WHISKEY: Int

Use this type for whiskey.

Value: 5

ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WINE

static val ALCOHOL_CONSUMPTION_BEVERAGE_TYPE_WINE: Int

Use this type for wine.

Value: 2

RECORD_TEMPORAL_TYPE_INSTANT

static val RECORD_TEMPORAL_TYPE_INSTANT: Int

The record represents an instantaneous event.

Value: 0

RECORD_TEMPORAL_TYPE_INTERVAL

static val RECORD_TEMPORAL_TYPE_INTERVAL: Int

The record represents an event over an interval.

Value: 1

RECORD_TEMPORAL_TYPE_LOCAL_DATE

static val RECORD_TEMPORAL_TYPE_LOCAL_DATE: Int

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

Value: 2

Public methods

equals

Added in API level 37
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.

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

Added in API level 37
open fun hashCode(): Int

Returns a hash code value for the object.

Return
Int a hash code value for this object.