HydrationRecord.Builder

public static final class HydrationRecord.Builder
extends Object

java.lang.Object
   ↳ android.health.connect.datatypes.HydrationRecord.Builder


Builder class for HydrationRecord

Summary

Public constructors

Builder(Metadata metadata, Instant startTime, Instant endTime, Volume volume)

Public methods

HydrationRecord build()
HydrationRecord.Builder clearEndZoneOffset()

Sets the start zone offset of this record to system default.

HydrationRecord.Builder clearStartZoneOffset()

Sets the start zone offset of this record to system default.

HydrationRecord.Builder setEndZoneOffset(ZoneOffset endZoneOffset)

Sets the zone offset of the user when the activity ended

HydrationRecord.Builder setStartZoneOffset(ZoneOffset startZoneOffset)

Sets the zone offset of the user when the activity started

Inherited methods

Public constructors

Builder

Added in API level 34
public Builder (Metadata metadata, 
                Instant startTime, 
                Instant endTime, 
                Volume volume)

Parameters
metadata Metadata: Metadata to be associated with the record. See Metadata. This value cannot be null.

startTime Instant: Start time of this activity This value cannot be null.

endTime Instant: End time of this activity This value cannot be null.

volume Volume: Volume of the liquids in Volume unit. Required field. Valid range: 0-100 liters. This value cannot be null.

Public methods

build

Added in API level 34
public HydrationRecord build ()

Returns
HydrationRecord Object of HydrationRecord This value cannot be null.

clearEndZoneOffset

Added in API level 34
public HydrationRecord.Builder clearEndZoneOffset ()

Sets the start zone offset of this record to system default.

Returns
HydrationRecord.Builder This value cannot be null.

clearStartZoneOffset

Added in API level 34
public HydrationRecord.Builder clearStartZoneOffset ()

Sets the start zone offset of this record to system default.

Returns
HydrationRecord.Builder This value cannot be null.

setEndZoneOffset

Added in API level 34
public HydrationRecord.Builder setEndZoneOffset (ZoneOffset endZoneOffset)

Sets the zone offset of the user when the activity ended

Parameters
endZoneOffset ZoneOffset: This value cannot be null.

Returns
HydrationRecord.Builder This value cannot be null.

setStartZoneOffset

Added in API level 34
public HydrationRecord.Builder setStartZoneOffset (ZoneOffset startZoneOffset)

Sets the zone offset of the user when the activity started

Parameters
startZoneOffset ZoneOffset: This value cannot be null.

Returns
HydrationRecord.Builder This value cannot be null.