# Model.Builder

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/hardware/info/Model.java+class:androidx.car.app.hardware.info.Model.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

*** ** * ** ***


```
public final class Model.Builder
```

<br />

*** ** * ** ***

A builder of `https://developer.android.com/reference/androidx/car/app/hardware/info/Model`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/hardware/info/Model.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/info/Model` | `https://developer.android.com/reference/androidx/car/app/hardware/info/Model.Builder#build()()` Constructs the `https://developer.android.com/reference/androidx/car/app/hardware/info/Model` defined by this builder. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/info/Model.Builder` | `https://developer.android.com/reference/androidx/car/app/hardware/info/Model.Builder#setManufacturer(androidx.car.app.hardware.common.CarValue<java.lang.String>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/common/CarValue<https://developer.android.com/reference/java/lang/String.html> manufacturer)` Sets the car manufacturer. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/info/Model.Builder` | `https://developer.android.com/reference/androidx/car/app/hardware/info/Model.Builder#setName(androidx.car.app.hardware.common.CarValue<java.lang.String>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/common/CarValue<https://developer.android.com/reference/java/lang/String.html> name)` Sets the car model name. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/info/Model.Builder` | `https://developer.android.com/reference/androidx/car/app/hardware/info/Model.Builder#setYear(androidx.car.app.hardware.common.CarValue<java.lang.Integer>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/common/CarValue<https://developer.android.com/reference/java/lang/Integer.html> year)` Sets the car model year. |

## Public constructors

### Builder

Added in 1.1.0

```
public Builder()
```

## Public methods

### build

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

```
public @NonNull Model build()
```

Constructs the `https://developer.android.com/reference/androidx/car/app/hardware/info/Model` defined by this builder.

### setManufacturer

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

```
public @NonNull Model.Builder setManufacturer(@NonNull CarValue<String> manufacturer)
```

Sets the car manufacturer.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `manufacturer` is `null` |

### setName

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

```
public @NonNull Model.Builder setName(@NonNull CarValue<String> name)
```

Sets the car model name.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `name` is `null` |

### setYear

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

```
public @NonNull Model.Builder setYear(@NonNull CarValue<Integer> year)
```

Sets the car model year.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `year` is `null` |