# TemplateInfo

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/TemplateInfo.java+class:androidx.car.app.model.TemplateInfo) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
public final class TemplateInfo
```

<br />

*** ** * ** ***

Stores information about `https://developer.android.com/reference/androidx/car/app/model/Template` returned from a `https://developer.android.com/reference/androidx/car/app/Screen`.

**This class is for use by host implementations and not by apps.**

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/model/TemplateInfo#TemplateInfo(java.lang.Class<? extends androidx.car.app.model.Template>,java.lang.String)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/androidx/car/app/model/Template> templateClass, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html templateId )` Constructs the info for the given template information provided. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/TemplateInfo#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/Class.html<https://developer.android.com/reference/androidx/car/app/model/Template>` | `https://developer.android.com/reference/androidx/car/app/model/TemplateInfo#getTemplateClass()()` Returns the type of template this instance contains. |
| `@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/TemplateInfo#getTemplateId()()` Returns the ID of the template. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/TemplateInfo#hashCode()()` |

## Public constructors

### TemplateInfo

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

```
public TemplateInfo(
    @NonNull Class<Template> templateClass,
    @NonNull String templateId
)
```

Constructs the info for the given template information provided.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/androidx/car/app/model/Template> templateClass` | the class of the template this info is for |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html templateId` | the unique id for the template |

## Public methods

### equals

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

### getTemplateClass

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

```
public @NonNull Class<Template> getTemplateClass()
```

Returns the type of template this instance contains.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/TemplateInfo#TemplateInfo(java.lang.Class<? extends androidx.car.app.model.Template>,java.lang.String)` |   |

### getTemplateId

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

```
public @NonNull String getTemplateId()
```

Returns the ID of the template.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/TemplateInfo#TemplateInfo(java.lang.Class<? extends androidx.car.app.model.Template>,java.lang.String)` |   |

### hashCode

```
public int hashCode()
```