# HeightRecord

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/HeightRecord.kt+class:androidx.health.connect.client.records.HeightRecord) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***


```
public final class HeightRecord implements Record
```

<br />

*** ** * ** ***

Captures the user's height.

## Summary

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregateMetric<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/Length>` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#HEIGHT_AVG()` Metric identifier to retrieve the average height from `https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregateMetric<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/Length>` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#HEIGHT_MAX()` Metric identifier to retrieve the maximum height from `https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregateMetric<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/Length>` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#HEIGHT_MIN()` Metric identifier to retrieve minimum height from `https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#HeightRecord(java.time.Instant,java.time.ZoneOffset,androidx.health.connect.client.units.Length,androidx.health.connect.client.records.metadata.Metadata)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html time, https://developer.android.com/reference/java/time/ZoneOffset.html zoneOffset, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/Length height, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/Length` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#getHeight()()` Height in `https://developer.android.com/reference/androidx/health/connect/client/units/Length` unit. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#getMetadata()()` Set of common metadata associated with the written record. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#getTime()()` Time the record happened. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#getZoneOffset()()` User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/InstantaneousRecord#time()`, or null if unknown. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/HeightRecord#toString()()` |

## Public fields

### HEIGHT_AVG

```
public static final @NonNull AggregateMetric<@NonNull Length> HEIGHT_AVG
```

Metric identifier to retrieve the average height from `https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult`.

### HEIGHT_MAX

```
public static final @NonNull AggregateMetric<@NonNull Length> HEIGHT_MAX
```

Metric identifier to retrieve the maximum height from `https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult`.

### HEIGHT_MIN

```
public static final @NonNull AggregateMetric<@NonNull Length> HEIGHT_MIN
```

Metric identifier to retrieve minimum height from `https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult`.

## Public constructors

### HeightRecord

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

```
public HeightRecord(
    @NonNull Instant time,
    ZoneOffset zoneOffset,
    @NonNull Length height,
    @NonNull Metadata metadata
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getHeight

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

```
public final @NonNull Length getHeight()
```

Height in `https://developer.android.com/reference/androidx/health/connect/client/units/Length` unit. Required field. Valid range: 0-3 meters.

### getMetadata

```
public @NonNull Metadata getMetadata()
```

Set of common metadata associated with the written record.

### getTime

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

```
public @NonNull Instant getTime()
```

Time the record happened.

### getZoneOffset

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

```
public ZoneOffset getZoneOffset()
```

User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/InstantaneousRecord#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.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```