# TabContents

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/TabContents.java+class:androidx.car.app.model.TabContents) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

*** ** * ** ***


```
@CarProtocol
@RequiresCarApi(value = 6)
public class TabContents implements Content
```

<br />

*** ** * ** ***

Represents the contents to display for a selected tab in a `https://developer.android.com/reference/androidx/car/app/model/TabTemplate`. Only certain templates may be used as content. See `https://developer.android.com/reference/androidx/car/app/model/TabContents.Builder#Builder(androidx.car.app.model.Template)` for more details.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/car/app/model/TabContents.Builder` A builder of `https://developer.android.com/reference/androidx/car/app/model/TabContents`. |

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/TabContents#CONTENT_ID() = "TAB_CONTENTS_CONTENT_ID"` Content ID for TabContents |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/TabContents#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/TabContents#getContentId()()` Returns the static content ID associated with TabContents. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/Template` | `https://developer.android.com/reference/androidx/car/app/model/TabContents#getTemplate()()` Returns the wrapped `https://developer.android.com/reference/androidx/car/app/model/Template` to display as the contents. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/TabContents#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/TabContents#toString()()` |

## Constants

### CONTENT_ID

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
public static final String CONTENT_ID = "TAB_CONTENTS_CONTENT_ID"
```

Content ID for TabContents

This Content ID will be used to refresh the displayed template in the TabContents.

## Public methods

### equals

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

### getContentId

```
public @NonNull String getContentId()
```

Returns the static content ID associated with TabContents.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/TabContents#CONTENT_ID()` |   |

### getTemplate

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
public @NonNull Template getTemplate()
```

Returns the wrapped `https://developer.android.com/reference/androidx/car/app/model/Template` to display as the contents.

### hashCode

```
public int hashCode()
```

### toString

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