# Power

Artifact: [androidx.health.connect:connect-client](https://developer.android.com/jetpack/androidx/releases/health-connect) [View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/units/Power.kt+class:androidx.health.connect.client.units.Power) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***


```
public final class Power implements Comparable<@NonNull Power>
```

<br />

*** ** * ** ***

Represents a unit of power. Supported units:

- watts - see `https://developer.android.com/reference/androidx/health/connect/client/units/Power#watts(kotlin.Double)`, `https://developer.android.com/reference/androidx/health/connect/client/units/package-summary#(kotlin.Double).watts()`

- kilocalories/day - see `https://developer.android.com/reference/androidx/health/connect/client/units/Power#kilocaloriesPerDay(kotlin.Double)`, `https://developer.android.com/reference/androidx/health/connect/client/units/package-summary#(kotlin.Double).kilocaloriesPerDay()`

## Summary

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/units/Power#compareTo(androidx.health.connect.client.units.Power)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/Power other)` |
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/units/Power#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final double` | `https://developer.android.com/reference/androidx/health/connect/client/units/Power#getKilocaloriesPerDay()()` Returns the power in kilocalories/day. |
| `final double` | `https://developer.android.com/reference/androidx/health/connect/client/units/Power#getWatts()()` Returns the power in Watts. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/units/Power#hashCode()()` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/Power` | `https://developer.android.com/reference/androidx/health/connect/client/units/Power#kilocaloriesPerDay(kotlin.Double)(double value)` Creates `https://developer.android.com/reference/androidx/health/connect/client/units/Power` with the specified value in kilocalories/day. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/units/Power#toString()()` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/Power` | `https://developer.android.com/reference/androidx/health/connect/client/units/Power#watts(kotlin.Double)(double value)` Creates `https://developer.android.com/reference/androidx/health/connect/client/units/Power` with the specified value in Watts. |

## Public methods

### compareTo

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

```
public int compareTo(@NonNull Power other)
```

### equals

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

### getKilocaloriesPerDay

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

```
public final double getKilocaloriesPerDay()
```

Returns the power in kilocalories/day.

### getWatts

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

```
public final double getWatts()
```

Returns the power in Watts.

### hashCode

```
public int hashCode()
```

### kilocaloriesPerDay

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

```
public static final @NonNull Power kilocaloriesPerDay(double value)
```

Creates `https://developer.android.com/reference/androidx/health/connect/client/units/Power` with the specified value in kilocalories/day.

### toString

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

### watts

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

```
public static final @NonNull Power watts(double value)
```

Creates `https://developer.android.com/reference/androidx/health/connect/client/units/Power` with the specified value in Watts.