# WeightRecord

# WeightRecord

Artifact:[androidx.health.connect:connect-client](https://developer.android.com/jetpack/androidx/releases/health-connect)  
[View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/records/WeightRecord.kt+class:androidx.health.connect.client.records.WeightRecord)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/health/connect/client/records/WeightRecord "View this page in Java")

<br />

```
class WeightRecord : Record
```

<br />

*** ** * ** ***

Captures the user's weight.

See[Mass](https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Mass)for supported units.

## Summary

|                                                                                                 ### Public companion properties                                                                                                  |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)`<`[Mass](https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Mass)`>` | [WEIGHT_AVG](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#WEIGHT_AVG()) Metric identifier to retrieve the average weight from[androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult). |
| [AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)`<`[Mass](https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Mass)`>` | [WEIGHT_MAX](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#WEIGHT_MAX()) Metric identifier to retrieve the maximum weight from[androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult). |
| [AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)`<`[Mass](https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Mass)`>` | [WEIGHT_MIN](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#WEIGHT_MIN()) Metric identifier to retrieve the minimum weight from[androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult). |

|                                                                                                                                                                                                                                                                                                                                                  ### Public constructors                                                                                                                                                                                                                                                                                                                                                   |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [WeightRecord](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#WeightRecord(java.time.Instant,java.time.ZoneOffset,androidx.health.connect.client.units.Mass,androidx.health.connect.client.records.metadata.Metadata))`(` ` time: `[Instant](https://developer.android.com/reference/java/time/Instant.html)`,` ` zoneOffset: `[ZoneOffset](https://developer.android.com/reference/java/time/ZoneOffset.html)`?,` ` weight: `[Mass](https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Mass)`,` ` metadata: `[Metadata](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata) `)` |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#hashCode())`()`                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#toString())`()`                                                                                            |

|                                                   ### Public properties                                                    |
|----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open `[Metadata](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata) | [metadata](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#metadata()) Set of common metadata associated with the written record.                                                                                                                |
| `open `[Instant](https://developer.android.com/reference/java/time/Instant.html)                                           | [time](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#time()) Time the record happened.                                                                                                                                                         |
| [Mass](https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Mass)                           | [weight](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#weight()) User's weight in kilograms.                                                                                                                                                   |
| `open `[ZoneOffset](https://developer.android.com/reference/java/time/ZoneOffset.html)`?`                                  | [zoneOffset](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#zoneOffset()) User experienced zone offset at[time](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#time()), or null if unknown. |

## Public companion properties

### WEIGHT_AVG

```
val WEIGHT_AVG: AggregateMetric<Mass>
```

Metric identifier to retrieve the average weight from[androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult).  

### WEIGHT_MAX

```
val WEIGHT_MAX: AggregateMetric<Mass>
```

Metric identifier to retrieve the maximum weight from[androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult).  

### WEIGHT_MIN

```
val WEIGHT_MIN: AggregateMetric<Mass>
```

Metric identifier to retrieve the minimum weight from[androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult).  

## Public constructors

### WeightRecord

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)  

```
WeightRecord(
    time: Instant,
    zoneOffset: ZoneOffset?,
    weight: Mass,
    metadata: Metadata
)
```  

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

```
open fun hashCode(): Int
```  

### toString

```
open fun toString(): String
```  

## Public properties

### metadata

```
open val metadata: Metadata
```

Set of common metadata associated with the written record.  

### time

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)  

```
open val time: Instant
```

Time the record happened.  

### weight

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)  

```
val weight: Mass
```

User's weight in kilograms. Required field. Valid range: 0-1000 kilograms.  

### zoneOffset

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)  

```
open val zoneOffset: ZoneOffset?
```

User experienced zone offset at[time](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/WeightRecord#time()), 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.