# Maneuver.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/navigation/model/Maneuver.java+class:androidx.car.app.navigation.model.Maneuver.Builder) 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/navigation/model/Maneuver.Builder "View this page in Java")


```
class Maneuver.Builder
```

<br />

*** ** * ** ***

A builder of `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder#Builder(int)(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Constructs a new instance of a `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver` | `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder#build()()` Constructs the `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver` defined by this builder. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder` | `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder#setIcon(androidx.car.app.model.CarIcon)(icon: https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon)` Sets an image representing the maneuver. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder` | `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder#setRoundaboutExitAngle(int)( roundaboutExitAngle: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1, to = 360) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Sets an exit angle for roundabout maneuvers. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder` | `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder#setRoundaboutExitNumber(int)(roundaboutExitNumber: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets an exit number for roundabout maneuvers. |

## Public constructors

### Builder

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

```
Builder(type: Int)
```

Constructs a new instance of a `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver.Builder`.

The type should be chosen to reflect the closest semantic meaning of the maneuver. In some cases, an exact type match is not possible, but choosing a similar or slightly more general type is preferred. Using `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver#TYPE_UNKNOWN()` is allowed, but some head units will not display any information in that case.

| Parameters |
|---|---|
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | one of the `TYPE_*` static constants defined in this class |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `type` is not a valid maneuver type |

## Public functions

### build

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

```
fun build(): Maneuver
```

Constructs the `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver` defined by this builder.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `type` includes an exit number and one has not been set, or if it includes an exit angle and one has not been set |

### setIcon

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

```
fun setIcon(icon: CarIcon): Maneuver.Builder
```

Sets an image representing the maneuver.

#### Icon Sizing Guidance

To minimize scaling artifacts across a wide range of car screens, apps should provide icons targeting a 128 x 128 dp bounding box. If the icon exceeds this maximum size in either one of the dimensions, it will be scaled down to be centered inside the bounding box while preserving its aspect ratio.

See `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon` for more details related to providing icon and image resources that work with different car screen pixel densities.

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

### setRoundaboutExitAngle

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

```
fun setRoundaboutExitAngle(
    roundaboutExitAngle: @IntRange(from = 1, to = 360) Int
): Maneuver.Builder
```

Sets an exit angle for roundabout maneuvers.

Use for when `type` is `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver#TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW_WITH_ANGLE()` or `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver#TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW_WITH_ANGLE()`. The `roundaboutExitAngle` represents the degrees traveled in circulation from the entrance to the exit.

For example, in a 4 exit example, if all the exits are equally spaced then exit 1 would be at 90 degrees, exit 2 at 180, exit 3 at 270 and exit 4 at 360. However if the exits are irregular then a different angle could be provided.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `type` does not include a exit angle or if `roundaboutExitAngle` is not greater than zero and less than or equal to 360 degrees |

### setRoundaboutExitNumber

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

```
fun setRoundaboutExitNumber(roundaboutExitNumber: @IntRange(from = 1) Int): Maneuver.Builder
```

Sets an exit number for roundabout maneuvers.

Use for when `type` is `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver#TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW()`, `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver#TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW()`, `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver#TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW_WITH_ANGLE()` or `https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver#TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW_WITH_ANGLE()`. The `
roundaboutExitNumber` starts from 1 to designate the first exit after joining the roundabout, and increases in circulation order.

For example, if the driver is joining a counter-clockwise roundabout with 4 exits, then the exit to the right would be exit #1, the one straight ahead would be exit #2, the one to the left would be exit #3 and the one used by the driver to join the roundabout would be exit #4.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `type` does not include a exit number, or if `roundaboutExitNumber` is not greater than zero |