# DataTypeCondition

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

*** ** * ** ***

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

<br />

```
class DataTypeCondition<T : Number, D : DataType<T, DataPoint<T>>>
```

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                                                                                                                                                                                                            ### Public constructors                                                                                                                                                                                                                                                                                                                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `<T : `[Number](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-number/index.html)`, D : `[DataType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType)`<T, `[DataPoint](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint)`<T>>> `[DataTypeCondition](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataTypeCondition#DataTypeCondition(androidx.health.services.client.data.DataType,kotlin.Number,androidx.health.services.client.data.ComparisonType))`(` ` dataType: D,` ` threshold: T,` ` comparisonType: `[ComparisonType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType) `)` |

|                                        ### 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/DataTypeCondition#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/DataTypeCondition#hashCode())`()`                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataTypeCondition#toString())`()`                                                                                            |

|                                                ### Public properties                                                 |
|----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ComparisonType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType) | [comparisonType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataTypeCondition#comparisonType()) The comparison type to use when comparing the threshold against the current value.                                           |
| `D`                                                                                                                  | [dataType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataTypeCondition#dataType()) [DataType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType)which this condition applies to. |
| `T`                                                                                                                  | [threshold](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataTypeCondition#threshold()) The threshold at which point this condition should be met.                                                                             |

## Public constructors

### DataTypeCondition

```
<T : Number, D : DataType<T, DataPoint<T>>> DataTypeCondition(
    dataType: D,
    threshold: T,
    comparisonType: ComparisonType
)
```  

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### comparisonType

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

```
val comparisonType: ComparisonType
```

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

### dataType

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

```
val dataType: D
```

[DataType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType)which this condition applies to.  

### threshold

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

```
val threshold: T
```

The threshold at which point this condition should be met.