# GolfShotEvent

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

*** ** * ** ***


```
public final class GolfShotEvent extends ExerciseEvent
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.health.services.client.data.ExerciseEvent](https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEvent) ||
|   | ↳ | [androidx.health.services.client.data.GolfShotEvent](https://developer.android.com/reference/androidx/health/services/client/data/GolfShotEvent) |

*** ** * ** ***

An `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEvent` that contains information about Golf Shot events for the current exercise.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/health/services/client/data/GolfShotEvent.GolfShotSwingType` Golf Shot Swing Types. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/services/client/data/GolfShotEvent#GolfShotEvent(java.time.Duration,androidx.health.services.client.data.GolfShotEvent.GolfShotSwingType)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html durationSinceBoot, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/GolfShotEvent.GolfShotSwingType swingType )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/GolfShotEvent#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/Duration.html` | `https://developer.android.com/reference/androidx/health/services/client/data/GolfShotEvent#getDurationSinceBoot()()` `https://developer.android.com/reference/java/time/Duration.html` since device boot when the golf shot was detected. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/GolfShotEvent.GolfShotSwingType` | `https://developer.android.com/reference/androidx/health/services/client/data/GolfShotEvent#getSwingType()()` The type of golf swing that was detected. |
| `int` | `https://developer.android.com/reference/androidx/health/services/client/data/GolfShotEvent#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/services/client/data/GolfShotEvent#toString()()` |

## Public constructors

### GolfShotEvent

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

```
public GolfShotEvent(
    @NonNull Duration durationSinceBoot,
    @NonNull GolfShotEvent.GolfShotSwingType swingType
)
```

## Public methods

### equals

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

### getDurationSinceBoot

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

```
public final @NonNull Duration getDurationSinceBoot()
```

`https://developer.android.com/reference/java/time/Duration.html` since device boot when the golf shot was detected.

### getSwingType

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

```
public final @NonNull GolfShotEvent.GolfShotSwingType getSwingType()
```

The type of golf swing that was detected.

### hashCode

```
public int hashCode()
```

### toString

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