# HealthEvent

# 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)

*** ** * ** ***

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

<br />

```
class HealthEvent
```

<br />

*** ** * ** ***

Represents a user's health event.

## Summary

|                                                                   ### Nested types                                                                   |
|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[HealthEvent.Type](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/HealthEvent.Type) Health event types. |

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

|                                        ### 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/services/client/data/HealthEvent#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/services/client/data/HealthEvent#hashCode())`()`                                                                                            |

|                                                    ### Public properties                                                     |
|------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Instant](https://developer.android.com/reference/java/time/Instant.html)                                                    | [eventTime](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/HealthEvent#eventTime()) Returns the time of the health event. |
| [DataPointContainer](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer) | [metrics](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/HealthEvent#metrics()) Gets metrics associated to the event.     |
| [HealthEvent.Type](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/HealthEvent.Type)     | [type](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/HealthEvent#type()) Gets the type of event.                         |

## Public constructors

### HealthEvent

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

```
HealthEvent(
    type: HealthEvent.Type,
    eventTime: Instant,
    metrics: DataPointContainer
)
```  

## Public functions

### equals

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

### hashCode

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

## Public properties

### eventTime

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

```
val eventTime: Instant
```

Returns the time of the health event.  

### metrics

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

```
val metrics: DataPointContainer
```

Gets metrics associated to the event.  

### type

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

```
val type: HealthEvent.Type
```

Gets the type of event.