Android 12 Developer Preview is here! Try it out, and give us your feedback!

Place.Builder

public static final class Place.Builder
extends Object

java.lang.Object
   ↳ androidx.car.app.model.Place.Builder


A builder of Place.

Summary

Public constructors

Builder(CarLocation location)

Returns a builder instance for a CarLocation.

Builder(Place place)

Returns a Place.Builder instance with the same data as the given Place instance.

Public methods

Place build()

Constructs the Place defined by this builder.

Place.Builder setMarker(PlaceMarker marker)

Sets the PlaceMarker that specifies how this place is to be displayed on a map.

Inherited methods

Public constructors

Builder

public Builder (CarLocation location)

Returns a builder instance for a CarLocation.

Parameters
location CarLocation: the geographical location associated with the place

Throws
NullPointerException if location is null

Builder

public Builder (Place place)

Returns a Place.Builder instance with the same data as the given Place instance.

Parameters
place Place

Public methods

build

public Place build ()

Constructs the Place defined by this builder.

Returns
Place

setMarker

public Place.Builder setMarker (PlaceMarker marker)

Sets the PlaceMarker that specifies how this place is to be displayed on a map.

Unless set with this method, the place will not have a marker.

Parameters
marker PlaceMarker

Returns
Place.Builder

Throws
NullPointerException if marker is null