# HeartRating

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/HeartRating.java+class:androidx.media3.common.HeartRating)

*** ** * ** ***


```
public final class HeartRating extends Rating
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.common.Rating](https://developer.android.com/reference/androidx/media3/common/Rating) ||
|   | ↳ | [androidx.media3.common.HeartRating](https://developer.android.com/reference/androidx/media3/common/HeartRating) |

*** ** * ** ***

A rating expressed as "heart" or "no heart". It can be used to indicate whether the content is a favorite.

## Summary

| ### Public fields |
|---|---|
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/HeartRating#isHeart()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/common/HeartRating#HeartRating()()` Creates a unrated instance. |
| `https://developer.android.com/reference/androidx/media3/common/HeartRating#HeartRating(boolean)(boolean isHeart)` Creates a rated instance. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/HeartRating#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` |
| `static https://developer.android.com/reference/androidx/media3/common/HeartRating` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/HeartRating#fromBundle(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html bundle)` Restores a `HeartRating` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `int` | `https://developer.android.com/reference/androidx/media3/common/HeartRating#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/HeartRating#isHeart()()` Returns whether the rating is "heart". |
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/HeartRating#isRated()()` Whether the rating exists or not. |
| `https://developer.android.com/reference/android/os/Bundle.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/HeartRating#toBundle()()` Returns a `https://developer.android.com/reference/android/os/Bundle.html` representing the information stored in this rating. |

| ### Inherited methods |
|---|
| From [androidx.media3.common.Rating](https://developer.android.com/reference/androidx/media3/common/Rating) |---|---| | `static https://developer.android.com/reference/androidx/media3/common/Rating` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/Rating#fromBundle(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html bundle)` Restores a `Rating` from a `https://developer.android.com/reference/android/os/Bundle.html`. | |

## Public fields

### isHeart

```
public final boolean isHeart
```

## Public constructors

### HeartRating

```
public HeartRating()
```

Creates a unrated instance.

### HeartRating

```
public HeartRating(boolean isHeart)
```

Creates a rated instance.

| Parameters |
|---|---|
| `boolean isHeart` | `true` for "heart", `false` for "no heart". |

## Public methods

### equals

```
public boolean equals(@Nullable Object obj)
```

### fromBundle

```
@UnstableApi
public static HeartRating fromBundle(Bundle bundle)
```

Restores a `HeartRating` from a `https://developer.android.com/reference/android/os/Bundle.html`.

### hashCode

```
public int hashCode()
```

### isHeart

```
public boolean isHeart()
```

Returns whether the rating is "heart".

### isRated

```
public boolean isRated()
```

Whether the rating exists or not.

### toBundle

```
@UnstableApi
public Bundle toBundle()
```

Returns a `https://developer.android.com/reference/android/os/Bundle.html` representing the information stored in this rating.