# ComparisonType

# ComparisonType

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/ComparisonType.kt+class:androidx.health.services.client.data.ComparisonType)  
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/ComparisonType "View this page in Java")

<br />

```
class ComparisonType
```

<br />

*** ** * ** ***

For determining when a threshold has been met or exceeded in a[DataTypeCondition](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataTypeCondition).

## Summary

|                                           ### Public companion properties                                            |
|----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ComparisonType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType) | [GREATER_THAN](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType#GREATER_THAN()) The comparison should be`currentValue > threshold`.                       |
| [ComparisonType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType) | [GREATER_THAN_OR_EQUAL](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType#GREATER_THAN_OR_EQUAL()) The comparison should be`currentValue >= threshold`.    |
| [ComparisonType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType) | [LESS_THAN](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType#LESS_THAN()) The comparison should be`currentValue < threshold`.                             |
| [ComparisonType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType) | [LESS_THAN_OR_EQUAL](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType#LESS_THAN_OR_EQUAL()) The comparison should be`currentValue <= threshold`.          |
| [ComparisonType](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType) | [UNKNOWN](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType#UNKNOWN()) The comparison type is unknown, or this library version is too old to recognize it. |

|                                        ### 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/ComparisonType#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/ComparisonType#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/ComparisonType#toString())`()`                                                                                            |

|                               ### Public properties                               |
|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)       | [id](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType#id())     |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [name](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ComparisonType#name()) |

## Public companion properties

### GREATER_THAN

```
val GREATER_THAN: ComparisonType
```

The comparison should be`currentValue > threshold`.  

### GREATER_THAN_OR_EQUAL

```
val GREATER_THAN_OR_EQUAL: ComparisonType
```

The comparison should be`currentValue >= threshold`.  

### LESS_THAN

```
val LESS_THAN: ComparisonType
```

The comparison should be`currentValue < threshold`.  

### LESS_THAN_OR_EQUAL

```
val LESS_THAN_OR_EQUAL: ComparisonType
```

The comparison should be`currentValue <= threshold`.  

### UNKNOWN

```
val UNKNOWN: ComparisonType
```

The comparison type is unknown, or this library version is too old to recognize it.  

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### id

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

```
val id: Int
```  

### name

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

```
val name: String
```