public final class NutritionRecord implements Record


Captures what nutrients were consumed as part of a meal or a food item.

Summary

Public fields

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total biotin from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total caffeine from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total calcium from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total chloride from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total cholesterol from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total chromium from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total copper from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total dietary fiber from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Energy>

Metric identifier to retrieve the total energy from fat from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Energy>

Metric identifier to retrieve the total energy from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total folate from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total folic acid from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total iodine from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total iron from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total magnesium from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total manganese from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total molybdenum from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total monounsaturated fat from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total niacin from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total pantothenic acid from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total phosphorus from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total polyunsaturated fat from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total potassium from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total protein from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total riboflavin from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total saturated fat from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total selenium from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total sodium from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total sugar from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total thiamin from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total total carbohydrate from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total total fat from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total trans fat from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total unsaturated fat from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total vitamin a from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total vitamin b12 from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total vitamin b6 from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total vitamin c from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total vitamin d from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total vitamin e from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total vitamin k from androidx.health.connect.client.aggregate.AggregationResult.

static final @NonNull AggregateMetric<@NonNull Mass>

Metric identifier to retrieve the total zinc from androidx.health.connect.client.aggregate.AggregationResult.

Public constructors

NutritionRecord(
    @NonNull Instant startTime,
    ZoneOffset startZoneOffset,
    @NonNull Instant endTime,
    ZoneOffset endZoneOffset,
    @NonNull Metadata metadata,
    Mass biotin,
    Mass caffeine,
    Mass calcium,
    Energy energy,
    Energy energyFromFat,
    Mass chloride,
    Mass cholesterol,
    Mass chromium,
    Mass copper,
    Mass dietaryFiber,
    Mass folate,
    Mass folicAcid,
    Mass iodine,
    Mass iron,
    Mass magnesium,
    Mass manganese,
    Mass molybdenum,
    Mass monounsaturatedFat,
    Mass niacin,
    Mass pantothenicAcid,
    Mass phosphorus,
    Mass polyunsaturatedFat,
    Mass potassium,
    Mass protein,
    Mass riboflavin,
    Mass saturatedFat,
    Mass selenium,
    Mass sodium,
    Mass sugar,
    Mass thiamin,
    Mass totalCarbohydrate,
    Mass totalFat,
    Mass transFat,
    Mass unsaturatedFat,
    Mass vitaminA,
    Mass vitaminB12,
    Mass vitaminB6,
    Mass vitaminC,
    Mass vitaminD,
    Mass vitaminE,
    Mass vitaminK,
    Mass zinc,
    String name,
    int mealType
)

Public methods

boolean
equals(Object other)
final Mass

Biotin in Mass unit.

final Mass

Caffeine in Mass unit.

final Mass

Calcium in Mass unit.

final Mass

Chloride in Mass unit.

final Mass

Cholesterol in Mass unit.

final Mass

Chromium in Mass unit.

final Mass

Copper in Mass unit.

final Mass

Dietary fiber in Mass unit.

@NonNull Instant

End time of the record.

ZoneOffset

User experienced zone offset at endTime, or null if unknown.

final Energy

Energy in Energy unit.

final Energy

Energy from fat in Energy unit.

final Mass

Folate in Mass unit.

final Mass

Folic acid in Mass unit.

final Mass

Iodine in Mass unit.

final Mass

Iron in Mass unit.

final Mass

Magnesium in Mass unit.

final Mass

Manganese in Mass unit.

final int

Type of meal related to the nutrients consumed.

@NonNull Metadata

Set of common metadata associated with the written record.

final Mass

Molybdenum in Mass unit.

final Mass

Monounsaturated fat in Mass unit.

final String

Name for food or drink, provided by the user.

final Mass

Niacin in Mass unit.

final Mass

Pantothenic acid in Mass unit.

final Mass

Phosphorus in Mass unit.

final Mass

Polyunsaturated fat in Mass unit.

final Mass

Potassium in Mass unit.

final Mass

Protein in Mass unit.

final Mass

Riboflavin in Mass unit.

final Mass

Saturated fat in Mass unit.

final Mass

Selenium in Mass unit.

final Mass

Sodium in Mass unit.

@NonNull Instant

Start time of the record.

ZoneOffset

User experienced zone offset at startTime, or null if unknown.

final Mass

Sugar in Mass unit.

final Mass

Thiamin in Mass unit.

final Mass

Total carbohydrate in Mass unit.

final Mass

Total fat in Mass unit.

final Mass

Trans fat in Mass unit.

final Mass

Unsaturated fat in Mass unit.

final Mass

Vitamin A in Mass unit.

final Mass

Vitamin B12 in Mass unit.

final Mass

Vitamin B6 in Mass unit.

final Mass

Vitamin C in Mass unit.

final Mass

Vitamin D in Mass unit.

final Mass

Vitamin E in Mass unit.

final Mass

Vitamin K in Mass unit.

final Mass

Zinc in Mass unit.

int
@NonNull String

Public fields

BIOTIN_TOTAL

public static final @NonNull AggregateMetric<@NonNull MassBIOTIN_TOTAL

Metric identifier to retrieve the total biotin from androidx.health.connect.client.aggregate.AggregationResult.

CAFFEINE_TOTAL

public static final @NonNull AggregateMetric<@NonNull MassCAFFEINE_TOTAL

Metric identifier to retrieve the total caffeine from androidx.health.connect.client.aggregate.AggregationResult.

CALCIUM_TOTAL

public static final @NonNull AggregateMetric<@NonNull MassCALCIUM_TOTAL

Metric identifier to retrieve the total calcium from androidx.health.connect.client.aggregate.AggregationResult.

CHLORIDE_TOTAL

public static final @NonNull AggregateMetric<@NonNull MassCHLORIDE_TOTAL

Metric identifier to retrieve the total chloride from androidx.health.connect.client.aggregate.AggregationResult.

CHOLESTEROL_TOTAL

public static final @NonNull AggregateMetric<@NonNull MassCHOLESTEROL_TOTAL

Metric identifier to retrieve the total cholesterol from androidx.health.connect.client.aggregate.AggregationResult.

CHROMIUM_TOTAL

public static final @NonNull AggregateMetric<@NonNull MassCHROMIUM_TOTAL

Metric identifier to retrieve the total chromium from androidx.health.connect.client.aggregate.AggregationResult.

COPPER_TOTAL

public static final @NonNull AggregateMetric<@NonNull MassCOPPER_TOTAL

Metric identifier to retrieve the total copper from androidx.health.connect.client.aggregate.AggregationResult.

DIETARY_FIBER_TOTAL