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

*** ** * ** ***


```
class DebouncedGoal<T : 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 companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal<T>` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-number/index.html> https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal#createAggregateDebouncedGoal(androidx.health.services.client.data.DebouncedDataTypeCondition)( condition: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedDataTypeCondition<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/AggregateDataType<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/StatisticalDataPoint<T>>> )` Creates a `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal` that is achieved once when given `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedDataTypeCondition` is satisfied for the `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/AggregateDataType`. |
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal<T>` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-number/index.html> https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal#createSampleDebouncedGoal(androidx.health.services.client.data.DebouncedDataTypeCondition)( condition: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedDataTypeCondition<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DeltaDataType<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint<T>>> )` Creates a `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal` that is achieved once when given `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedDataTypeCondition` is satisfied for the `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DeltaDataType`. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedDataTypeCondition<T, *>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal#debouncedDataTypeCondition()` The condition which specifies data type, threshold, comparison type and debounced params. |

## Public companion functions

### createAggregateDebouncedGoal

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

```
fun <T : Number> createAggregateDebouncedGoal(
    condition: DebouncedDataTypeCondition<T, AggregateDataType<T, StatisticalDataPoint<T>>>
): DebouncedGoal<T>
```

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

| Parameters |
|---|---|
| `condition: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedDataTypeCondition<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/AggregateDataType<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/StatisticalDataPoint<T>>>` | 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/kotlin/androidx/health/services/client/data/DebouncedGoal<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)

```
fun <T : Number> createSampleDebouncedGoal(
    condition: DebouncedDataTypeCondition<T, DeltaDataType<T, SampleDataPoint<T>>>
): DebouncedGoal<T>
```

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

| Parameters |
|---|---|
| `condition: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedDataTypeCondition<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DeltaDataType<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint<T>>>` | 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/kotlin/androidx/health/services/client/data/DebouncedGoal<T>` | a debounced goal that is triggered when the condition is met |

## Public functions

### equals

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

### hashCode

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

### toString

```
open fun toString(): String
```

## Public properties

### debouncedDataTypeCondition

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

```
val debouncedDataTypeCondition: DebouncedDataTypeCondition<T, *>
```

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