Enum HealthDataKind
- All Implemented Interfaces:
Comparable<HealthDataKind>
HealthDataType produces, and therefore which
HealthSample subclass a query for it returns.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn enumerated observation with no natural unit -- menstrual flow, a single sleep stage.A reading made of several named values that only mean something together -- a blood pressure, which is a systolic and a diastolic.A numeric measurement with a unit -- steps, heart rate, body mass.A run of measurements sharing one record identity -- a beat-to-beat heart-rate trace.A bounded activity with child data -- a workout, a night's sleep. -
Method Summary
Modifier and TypeMethodDescriptionstatic HealthDataKindReturns the enum constant of this type with the specified name.static HealthDataKind[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
QUANTITY
A numeric measurement with a unit -- steps, heart rate, body mass. ProducesQuantitySample. Maps toHKQuantitySampleand to Health Connect's numeric record types. -
CATEGORY
An enumerated observation with no natural unit -- menstrual flow, a single sleep stage. ProducesCategorySample. Maps toHKCategorySample. -
SERIES
A run of measurements sharing one record identity -- a beat-to-beat heart-rate trace. Produces
SeriesSample.This kind exists because the two platforms disagree: Health Connect's
HeartRateRecordis one record containing N samples, while HealthKit returns N independent samples. SeeSampleQuery.setFlattenSeries(boolean). -
SESSION
A bounded activity with child data -- a workout, a night's sleep. Produces aSessionSamplesubclass. -
COMPOSITE
A reading made of several named values that only mean something together -- a blood pressure, which is a systolic and a diastolic. Produces
BloodPressureSample.It is not
QUANTITY. Calling it one let generic code dispatch on the kind, cast a stored reading toQuantitySampleand fail with a ClassCastException -- and let a caller build a one-number quantity for a type that has no single number, which the platforms then had to refuse or, worse, store as half a reading.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-