public final class HydrationRecord implements Record


Captures how much water a user drank in a single drink.

Summary

Public fields

static final @NonNull AggregateMetric<@NonNull Volume>

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

Public constructors

HydrationRecord(
    @NonNull Instant startTime,
    ZoneOffset startZoneOffset,
    @NonNull Instant endTime,
    ZoneOffset endZoneOffset,
    @NonNull Volume volume,
    @NonNull Metadata metadata
)

Public methods

boolean
equals(Object other)
@NonNull Instant

End time of the record.

ZoneOffset

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

@NonNull Metadata

Set of common metadata associated with the written record.

@NonNull Instant

Start time of the record.

ZoneOffset

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

final @NonNull Volume

Volume of water in Volume unit.

int
@NonNull String

Public fields

VOLUME_TOTAL

public static final @NonNull AggregateMetric<@NonNull VolumeVOLUME_TOTAL

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

Public constructors

HydrationRecord

Added in 1.1.0-alpha10
public HydrationRecord(
    @NonNull Instant startTime,
    ZoneOffset startZoneOffset,
    @NonNull Instant endTime,
    ZoneOffset endZoneOffset,
    @NonNull Volume volume,
    @NonNull Metadata metadata
)

Public methods

equals

public boolean equals(Object other)

getEndTime

Added in 1.1.0-alpha10
public @NonNull Instant getEndTime()

End time of the record.

getEndZoneOffset

Added in 1.1.0-alpha10
public ZoneOffset getEndZoneOffset()

User experienced zone offset at endTime, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.

getMetadata

Added in 1.1.0-alpha10
public @NonNull Metadata getMetadata()

Set of common metadata associated with the written record.

getStartTime

Added in 1.1.0-alpha10
public @NonNull Instant getStartTime()

Start time of the record.

getStartZoneOffset

Added in 1.1.0-alpha10
public ZoneOffset getStartZoneOffset()

User experienced zone offset at startTime, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.

getVolume

Added in 1.1.0-alpha10
public final @NonNull Volume getVolume()

Volume of water in Volume unit. Required field. Valid range: 0-100 liters.

hashCode

public int hashCode()

toString

public @NonNull String toString()