# HealthEvent

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

*** ** * ** ***


```
public final class HealthEvent
```

<br />

*** ** * ** ***

Represents a user's health event.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/health/services/client/data/HealthEvent.Type` Health event types. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/services/client/data/HealthEvent#HealthEvent(androidx.health.services.client.data.HealthEvent.Type,java.time.Instant,androidx.health.services.client.data.DataPointContainer)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/HealthEvent.Type type, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html eventTime, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DataPointContainer metrics )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/HealthEvent#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/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/services/client/data/HealthEvent#getEventTime()()` Returns the time of the health event. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DataPointContainer` | `https://developer.android.com/reference/androidx/health/services/client/data/HealthEvent#getMetrics()()` Gets metrics associated to the event. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/HealthEvent.Type` | `https://developer.android.com/reference/androidx/health/services/client/data/HealthEvent#getType()()` Gets the type of event. |
| `int` | `https://developer.android.com/reference/androidx/health/services/client/data/HealthEvent#hashCode()()` |

## Public constructors

### HealthEvent

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

```
public HealthEvent(
    @NonNull HealthEvent.Type type,
    @NonNull Instant eventTime,
    @NonNull DataPointContainer metrics
)
```

## Public methods

### equals

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

### getEventTime

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

```
public final @NonNull Instant getEventTime()
```

Returns the time of the health event.

### getMetrics

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

```
public final @NonNull DataPointContainer getMetrics()
```

Gets metrics associated to the event.

### getType

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

```
public final @NonNull HealthEvent.Type getType()
```

Gets the type of event.

### hashCode

```
public int hashCode()
```