# Pressure

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Methods](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure#inhmethods)  

# Pressure

*** ** * ** ***

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

`
public

final

class
Pressure
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Comparable](https://developer.android.com/reference/java/lang/Comparable)`<`[Pressure](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure)`>


`

|---|-------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.health.connect.datatypes.units.Pressure |

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                      ||
|---------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                                                        | ` `[compareTo](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure#compareTo(android.health.connect.datatypes.units.Pressure))`(`[Pressure](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure)` other) ` Compares this object with the specified object for order. |
| ` boolean`                                                                                                    | ` `[equals](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` object) ` Indicates whether some other object is "equal to" this one.                                                                    |
| ` static `[Pressure](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure) | ` `[fromMillimetersOfMercury](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure#fromMillimetersOfMercury(double))`(double value) ` Creates a Pressure object with the specified value in millimeters of Mercury (mmHg).                                                                                |
| ` double`                                                                                                     | ` `[getInMillimetersOfMercury](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure#getInMillimetersOfMercury())`() ` Returns pressure in millimeters of mercury                                                                                                                                          |
| ` int`                                                                                                        | ` `[hashCode](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                                             |
| ` `[String](https://developer.android.com/reference/java/lang/String)                                         | ` `[toString](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure#toString())`() ` Returns a string representation of the object.                                                                                                                                                                        |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||
| From interface` `[java.lang.Comparable](https://developer.android.com/reference/java/lang/Comparable)` ` |-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int` | ` `[compareTo](https://developer.android.com/reference/java/lang/Comparable#compareTo(T))`(`[Pressure](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure)` o) ` Compares this object with the specified object for order. | ||

## Public methods

### compareTo

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

```
public int compareTo (Pressure other)
```

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.

<br />

|                                     Parameters                                     ||
|---------|---------------------------------------------------------------------------|
| `other` | `Pressure`: the object to be compared. This value cannot be`null`. <br /> |

|                                                                  Returns                                                                   ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------|
| `int` | a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. <br /> |

|                                                                                     Throws                                                                                     ||
|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| [NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException) | if the specified object is null                                                |
| [ClassCastException](https://developer.android.com/reference/java/lang/ClassCastException)     | if the specified object's type prevents it from being compared to this object. |

### equals

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

```
public boolean equals (Object object)
```

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

<br />

|                               Parameters                               ||
|----------|--------------------------------------------------------------|
| `object` | `Object`: the reference object with which to compare. <br /> |

|                                           Returns                                           ||
|-----------|----------------------------------------------------------------------------------|
| `boolean` | `true`if this object is the same as the object argument;`false`otherwise. <br /> |

### fromMillimetersOfMercury

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

```
public static Pressure fromMillimetersOfMercury (double value)
```

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

<br />

|                              Parameters                              ||
|---------|-------------------------------------------------------------|
| `value` | `double`: value to be set as millimeters of Mercury. <br /> |

|                                                                 Returns                                                                 ||
|-----------------------------------------------------------------------------------------------------|------------------------------------|
| [Pressure](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure) | This value cannot be`null`. <br /> |

### getInMillimetersOfMercury

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

```
public double getInMillimetersOfMercury ()
```

Returns pressure in millimeters of mercury

<br />

|     Returns      ||
|----------|--------|
| `double` | <br /> |

### hashCode

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

```
public int hashCode ()
```

Returns a hash code value for the object.

<br />

|                     Returns                      ||
|-------|-------------------------------------------|
| `int` | a hash code value for this object. <br /> |

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | a string representation of the object. <br /> |