# TemplateInfo

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/model/TemplateInfo "View this page in Java")

<br />

```
@CarProtocol
class TemplateInfo
```

<br />

*** ** * ** ***

Stores information about[Template](https://developer.android.com/reference/kotlin/androidx/car/app/model/Template)returned from a[androidx.car.app.Screen](https://developer.android.com/reference/kotlin/androidx/car/app/Screen).

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

## Summary

|                                                                                                                                                                                                                                                                 ### Public constructors                                                                                                                                                                                                                                                                 |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TemplateInfo](https://developer.android.com/reference/kotlin/androidx/car/app/model/TemplateInfo#TemplateInfo(java.lang.Class<? extends androidx.car.app.model.Template>,java.lang.String))`(templateClass: `[Class](https://developer.android.com/reference/java/lang/Class.html)`<`[Template](https://developer.android.com/reference/kotlin/androidx/car/app/model/Template)`!>, templateId: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Constructs the info for the given template information provided. |

|                                                                          ### Public functions                                                                          |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                    | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/model/TemplateInfo#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| [Class](https://developer.android.com/reference/java/lang/Class.html)`<`[Template](https://developer.android.com/reference/kotlin/androidx/car/app/model/Template)`!>` | [getTemplateClass](https://developer.android.com/reference/kotlin/androidx/car/app/model/TemplateInfo#getTemplateClass())`()` Returns the type of template this instance contains.                             |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                      | [getTemplateId](https://developer.android.com/reference/kotlin/androidx/car/app/model/TemplateInfo#getTemplateId())`()` Returns the ID of the template.                                                        |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                            | [hashCode](https://developer.android.com/reference/kotlin/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)  

```
TemplateInfo(templateClass: Class<Template!>, templateId: String)
```

Constructs the info for the given template information provided.  

|                                                                                       Parameters                                                                                        |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `templateClass: `[Class](https://developer.android.com/reference/java/lang/Class.html)`<`[Template](https://developer.android.com/reference/kotlin/androidx/car/app/model/Template)`!>` | the class of the template this info is for |
| `templateId: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                         | the unique id for the template             |

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```  

### getTemplateClass

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

```
fun getTemplateClass(): Class<Template!>
```

Returns the type of template this instance contains.  

|                                                                                           See also                                                                                           |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [TemplateInfo](https://developer.android.com/reference/kotlin/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)  

```
fun getTemplateId(): String
```

Returns the ID of the template.  

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

### hashCode

```
fun hashCode(): Int
```