Destination.Builder
public final class Destination.Builder
A builder of Destination.
Summary
Public methods |
|
|---|---|
@NonNull Destination |
build()Constructs the |
@NonNull Destination.Builder |
setAddress(@NonNull CharSequence address)Sets the destination address formatted for the user's current locale. |
@NonNull Destination.Builder |
Sets the destination image to display. |
@NonNull Destination.Builder |
setName(@NonNull CharSequence name)Sets the destination name formatted for the user's current locale. |
Public methods
build
public @NonNull Destination build()
Constructs the Destination defined by this builder.
At least one of the name or the address must be set and not empty.
| Throws | |
|---|---|
java.lang.IllegalStateException |
if both the name and the address are |
| See also | |
|---|---|
setName |
|
setAddress |
setAddress
public @NonNull Destination.Builder setAddress(@NonNull CharSequence address)
Sets the destination address formatted for the user's current locale.
Spans are not supported in the input string and will be ignored.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
| See also | |
|---|---|
CarText |
setImage
public @NonNull Destination.Builder setImage(@NonNull CarIcon image)
Sets the destination image to display.
Image Sizing Guidance To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 128 x 128 dp bounding box. If the image exceeds this maximum size in either one of the dimensions, it will be scaled down to be centered inside the bounding box while preserving the aspect ratio.See CarIcon for more details related to providing icon and image resources that work with different car screen pixel densities.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
setName
public @NonNull Destination.Builder setName(@NonNull CharSequence name)
Sets the destination name formatted for the user's current locale.
Spans are not supported in the input string and will be ignored.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
| See also | |
|---|---|
CarText |