Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

# Pressure

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure "View this page in Java")

```
class Pressure : Comparable<Pressure!>
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.health.connect.datatypes.units.Pressure](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#) |

Represents a unit of pressure. Supported units: millimeters of Mercury (mmHg)

## Summary

| Public methods ||
|---|---|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#compareTo(android.health.connect.datatypes.units.Pressure)(other: https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#)` Compares this object with the specified object for order. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#equals(kotlin.Any)(other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?)` Indicates whether some other object is "equal to" this one. |
| static [Pressure](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#fromMillimetersOfMercury(kotlin.Double)(value: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)` Creates a Pressure object with the specified value in millimeters of Mercury (mmHg). |
| [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#getInMillimetersOfMercury()()` Returns pressure in millimeters of mercury |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#hashCode()()` Returns a hash code value for the object. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#toString()()` <br /> |

## Public methods

### compareTo

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
fun compareTo(other: Pressure): Int
```

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

| Parameters ||
|---|---|
| `o` | the object to be compared. |
| `other` | [Pressure](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#): the object to be compared. This value cannot be `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. |

| Exceptions ||
|---|---|
| `java.lang.ClassCastException` | if the specified object's type prevents it from being compared to this object. |
| `java.lang.NullPointerException` | if the specified object is null |

### equals

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

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

Indicates whether some other object is "equal to" this one.

| Parameters ||
|---|---|
| `obj` | the reference object with which to compare. |
| `object` | the reference object with which to compare. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `true` if this object is the same as the object argument; `false` otherwise. |

### fromMillimetersOfMercury

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
static fun fromMillimetersOfMercury(value: Double): Pressure
```

Creates a Pressure object with the specified value in millimeters of Mercury (mmHg).

| Parameters ||
|---|---|
| `value` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html): value to be set as millimeters of Mercury. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Pressure#` | This value cannot be `null`. |

### getInMillimetersOfMercury

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
fun getInMillimetersOfMercury(): Double
```

Returns pressure in millimeters of mercury

### hashCode

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

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

Returns a hash code value for the object.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a hash code value for this object. |

### toString

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

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

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | a string representation of the object. |