# DebouncedGoal

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

*** ** * ** ***


```
public final class DebouncedGoal<T extends Number>
```

<br />

*** ** * ** ***

Defines a debounced goal for an exercise. Debounced means, the goal will be triggered only after the threshold has been crossed for a specified duration of time, e.g. initialDelay and durationAtThreshold. Only applies to sample data types(e.g. heart rate, speed) and aggregate data type with statistical data points(e.g. pace stats).

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | `<T extends https://developer.android.com/reference/java/lang/Number.html> https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal#createAggregateDebouncedGoal(androidx.health.services.client.data.DebouncedDataTypeCondition)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedDataTypeCondition<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/AggregateDataType<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/StatisticalDataPoint<@https://developer.android.com/reference/androidx/annotation/NonNull T>>> condition )` Creates a `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` that is achieved once when given `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedDataTypeCondition` is satisfied for the `https://developer.android.com/reference/androidx/health/services/client/data/AggregateDataType`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | `<T extends https://developer.android.com/reference/java/lang/Number.html> https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal#createSampleDebouncedGoal(androidx.health.services.client.data.DebouncedDataTypeCondition)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedDataTypeCondition<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DeltaDataType<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/SampleDataPoint<@https://developer.android.com/reference/androidx/annotation/NonNull T>>> condition )` Creates a `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` that is achieved once when given `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedDataTypeCondition` is satisfied for the `https://developer.android.com/reference/androidx/health/services/client/data/DeltaDataType`. |
| `boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal#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/services/client/data/DebouncedDataTypeCondition<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull ?>` | `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal#getDebouncedDataTypeCondition()()` The condition which specifies data type, threshold, comparison type and debounced params. |
| `int` | `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal#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/DebouncedGoal#toString()()` |

## Public methods

### createAggregateDebouncedGoal

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

```
public static final @NonNull DebouncedGoal<@NonNull T> <T extends Number> createAggregateDebouncedGoal(
    @NonNull DebouncedDataTypeCondition<@NonNull T, @NonNull AggregateDataType<@NonNull T, @NonNull StatisticalDataPoint<@NonNull T>>> condition
)
```

Creates a `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` that is achieved once when given `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedDataTypeCondition` is satisfied for the `https://developer.android.com/reference/androidx/health/services/client/data/AggregateDataType`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedDataTypeCondition<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/AggregateDataType<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/StatisticalDataPoint<@https://developer.android.com/reference/androidx/annotation/NonNull T>>> condition` | the debounced data type condition for an aggregate data type, and whose value represents an average value, e.g. average heart rate |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | a debounced goal that is triggered when the condition is met |

### createSampleDebouncedGoal

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

```
public static final @NonNull DebouncedGoal<@NonNull T> <T extends Number> createSampleDebouncedGoal(
    @NonNull DebouncedDataTypeCondition<@NonNull T, @NonNull DeltaDataType<@NonNull T, @NonNull SampleDataPoint<@NonNull T>>> condition
)
```

Creates a `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` that is achieved once when given `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedDataTypeCondition` is satisfied for the `https://developer.android.com/reference/androidx/health/services/client/data/DeltaDataType`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedDataTypeCondition<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DeltaDataType<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/SampleDataPoint<@https://developer.android.com/reference/androidx/annotation/NonNull T>>> condition` | the debounced data type condition for a sample data type, and whose value represents an instantaneous value, e.g. instantaneous heart rate |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | a debounced goal that is triggered when the condition is met |

### equals

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

### getDebouncedDataTypeCondition

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

```
public final @NonNull DebouncedDataTypeCondition<@NonNull T, @NonNull ?> getDebouncedDataTypeCondition()
```

The condition which specifies data type, threshold, comparison type and debounced params. The condition must be met in order to trigger the goal.

### hashCode

```
public int hashCode()
```

### toString

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