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

*** ** * ** ***


```
public final class ComparisonType
```

<br />

*** ** * ** ***

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

## Summary

| ### Public fields |
|---|---|
| `static 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/ComparisonType#GREATER_THAN()` The comparison should be `currentValue > threshold`. |
| `static 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/ComparisonType#GREATER_THAN_OR_EQUAL()` The comparison should be `currentValue >= threshold`. |
| `static 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/ComparisonType#LESS_THAN()` The comparison should be `currentValue < threshold`. |
| `static 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/ComparisonType#LESS_THAN_OR_EQUAL()` The comparison should be `currentValue <= threshold`. |
| `static 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/ComparisonType#UNKNOWN()` The comparison type is unknown, or this library version is too old to recognize it. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/ComparisonType#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final int` | `https://developer.android.com/reference/androidx/health/services/client/data/ComparisonType#getId()()` |
| `final @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/ComparisonType#getName()()` |
| `int` | `https://developer.android.com/reference/androidx/health/services/client/data/ComparisonType#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/ComparisonType#toString()()` |

## Public fields

### GREATER_THAN

```
public static final @NonNull ComparisonType GREATER_THAN
```

The comparison should be `currentValue > threshold`.

### GREATER_THAN_OR_EQUAL

```
public static final @NonNull ComparisonType GREATER_THAN_OR_EQUAL
```

The comparison should be `currentValue >= threshold`.

### LESS_THAN

```
public static final @NonNull ComparisonType LESS_THAN
```

The comparison should be `currentValue < threshold`.

### LESS_THAN_OR_EQUAL

```
public static final @NonNull ComparisonType LESS_THAN_OR_EQUAL
```

The comparison should be `currentValue <= threshold`.

### UNKNOWN

```
public static final @NonNull ComparisonType UNKNOWN
```

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

## Public methods

### equals

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

### getId

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

```
public final int getId()
```

### getName

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

```
public final @NonNull String getName()
```

### hashCode

```
public int hashCode()
```

### toString

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