# DataTypeCondition

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

*** ** * ** ***


```
public final class DataTypeCondition<T extends Number, D extends DataType<@NonNull T, @NonNull DataPoint<@NonNull T>>>
```

<br />

*** ** * ** ***

A condition which is considered met when a data type value passes a defined threshold.

## Summary

| ### Public constructors |
|---|
| `<T extends https://developer.android.com/reference/java/lang/Number.html, D extends https://developer.android.com/reference/androidx/health/services/client/data/DataType<@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/DataPoint<@https://developer.android.com/reference/androidx/annotation/NonNull T>>> https://developer.android.com/reference/androidx/health/services/client/data/DataTypeCondition#DataTypeCondition(androidx.health.services.client.data.DataType,kotlin.Number,androidx.health.services.client.data.ComparisonType)( @https://developer.android.com/reference/androidx/annotation/NonNull D dataType, @https://developer.android.com/reference/androidx/annotation/NonNull T threshold, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ComparisonType comparisonType )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/DataTypeCondition#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/ComparisonType` | `https://developer.android.com/reference/androidx/health/services/client/data/DataTypeCondition#getComparisonType()()` The comparison type to use when comparing the threshold against the current value. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull D` | `https://developer.android.com/reference/androidx/health/services/client/data/DataTypeCondition#getDataType()()` `https://developer.android.com/reference/androidx/health/services/client/data/DataType` which this condition applies to. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull T` | `https://developer.android.com/reference/androidx/health/services/client/data/DataTypeCondition#getThreshold()()` The threshold at which point this condition should be met. |
| `int` | `https://developer.android.com/reference/androidx/health/services/client/data/DataTypeCondition#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/DataTypeCondition#toString()()` |

## Public constructors

### DataTypeCondition

```
public <T extends Number, D extends DataType<@NonNull T, @NonNull DataPoint<@NonNull T>>> DataTypeCondition(
    @NonNull D dataType,
    @NonNull T threshold,
    @NonNull ComparisonType comparisonType
)
```

## Public methods

### equals

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

### getComparisonType

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

```
public final @NonNull ComparisonType getComparisonType()
```

The comparison type to use when comparing the threshold against the current value.

### getDataType

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

```
public final @NonNull D getDataType()
```

`https://developer.android.com/reference/androidx/health/services/client/data/DataType` which this condition applies to.

### getThreshold

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

```
public final @NonNull T getThreshold()
```

The threshold at which point this condition should be met.

### hashCode

```
public int hashCode()
```

### toString

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