It's the 15th anniversary of Google Maps Platform!   Check out the latest news and announcements.

FindAutocompletePredictionsRequest.Builder

public static abstract class FindAutocompletePredictionsRequest.Builder extends Object

Public Constructor Summary

Public Method Summary

FindAutocompletePredictionsRequest
build()
abstract CancellationToken
getCancellationToken()
Gets the CancellationToken used by PlacesClient to cancel any queued requests.
abstract List<String>
getCountries()
Gets the list of countries that restrict the location of the results.
abstract LocationBias
getLocationBias()
Gets the location bias applied for autocomplete predictions.
abstract LocationRestriction
getLocationRestriction()
Gets the location restriction applied for autocomplete predictions.
abstract LatLng
getOrigin()
Gets the location where getDistanceMeters() is calculated from.
abstract String
getQuery()
Gets the user query string used to generate autocomplete predictions.
abstract AutocompleteSessionToken
getSessionToken()
Gets the AutocompleteSessionToken for this request.
abstract TypeFilter
getTypeFilter()
Gets the filter that restricts the type of the results included in the response.
abstract FindAutocompletePredictionsRequest.Builder
setCancellationToken(CancellationToken cancellationToken)
Sets the CancellationToken used by PlacesClient to cancel any queued requests.
FindAutocompletePredictionsRequest.Builder
abstract FindAutocompletePredictionsRequest.Builder
setCountries(List<String> countries)
Sets the list of countries that restrict the location of the results.
FindAutocompletePredictionsRequest.Builder
setCountry(String countryCode)
See setCountries(String...) for details.
abstract FindAutocompletePredictionsRequest.Builder
setLocationBias(LocationBias locationBias)
Sets the location bias applied for autocomplete predictions.
abstract FindAutocompletePredictionsRequest.Builder
setLocationRestriction(LocationRestriction locationRestriction)
Sets the location restriction applied for autocomplete predictions.
abstract FindAutocompletePredictionsRequest.Builder
setOrigin(LatLng origin)
Sets the location where getDistanceMeters() is calculated from.
abstract FindAutocompletePredictionsRequest.Builder
setQuery(String query)
Sets the user query string used to generate autocomplete predictions.
abstract FindAutocompletePredictionsRequest.Builder
setSessionToken(AutocompleteSessionToken sessionToken)
Sets the AutocompleteSessionToken for this request.
abstract FindAutocompletePredictionsRequest.Builder
setTypeFilter(TypeFilter typeFilter)
Sets the filter that restricts the type of the results included in the response.

Inherited Method Summary

Public Constructors

public FindAutocompletePredictionsRequest.Builder ()

Public Methods

public abstract CancellationToken getCancellationToken ()

Gets the CancellationToken used by PlacesClient to cancel any queued requests.

public abstract List<String> getCountries ()

Gets the list of countries that restrict the location of the results.

See setCountries(List) for details.

public abstract LocationBias getLocationBias ()

Gets the location bias applied for autocomplete predictions. See setLocationBias(LocationBias) for details.

public abstract LocationRestriction getLocationRestriction ()

Gets the location restriction applied for autocomplete predictions. See setLocationRestriction(LocationRestriction) for details.

public abstract LatLng getOrigin ()

Gets the location where getDistanceMeters() is calculated from. If null, no distances will be included in the response.

public abstract String getQuery ()

Gets the user query string used to generate autocomplete predictions. If null or empty, no predictions will be included in the response.

public abstract AutocompleteSessionToken getSessionToken ()

Gets the AutocompleteSessionToken for this request.

public abstract TypeFilter getTypeFilter ()

Gets the filter that restricts the type of the results included in the response.

Possible values:

public abstract FindAutocompletePredictionsRequest.Builder setCancellationToken (CancellationToken cancellationToken)

Sets the CancellationToken used by PlacesClient to cancel any queued requests.

Parameters
cancellationToken

public FindAutocompletePredictionsRequest.Builder setCountries (String... countries)

Parameters
countries

public abstract FindAutocompletePredictionsRequest.Builder setCountries (List<String> countries)

Sets the list of countries that restrict the location of the results.

This must be a list of ISO 3166-1 Alpha-2 country codes (case insensitive). If empty, country restrictions will not be applied.

This will override values set with setCountry(String).

Up to five countries are supported. See the components parameter here.

Parameters
countries

public FindAutocompletePredictionsRequest.Builder setCountry (String countryCode)

See setCountries(String...) for details.

This will override countries set with setCountries(String...).

Parameters
countryCode

public abstract FindAutocompletePredictionsRequest.Builder setLocationBias (LocationBias locationBias)

Sets the location bias applied for autocomplete predictions. If null, location biases will not be applied.

Note: the autocomplete predictions will not necessarily be within the location specified. To enforce a restriction, use setLocationRestriction(LocationRestriction). You may not set both LocationBias and LocationRestriction simultaneously.

Parameters
locationBias

public abstract FindAutocompletePredictionsRequest.Builder setLocationRestriction (LocationRestriction locationRestriction)

Sets the location restriction applied for autocomplete predictions. If null, location restrictions will not be applied.

To impose a location bias instead, use setLocationBias(LocationBias). You may not set both LocationBias and LocationRestriction simultaneously.

Parameters
locationRestriction

public abstract FindAutocompletePredictionsRequest.Builder setOrigin (LatLng origin)

Sets the location where getDistanceMeters() is calculated from. If null, no distances will be included in the response.

Parameters
origin

public abstract FindAutocompletePredictionsRequest.Builder setQuery (String query)

Sets the user query string used to generate autocomplete predictions. If null or empty, no predictions will be included in the response.

Parameters
query

public abstract FindAutocompletePredictionsRequest.Builder setSessionToken (AutocompleteSessionToken sessionToken)

Sets the AutocompleteSessionToken for this request.

Parameters
sessionToken

public abstract FindAutocompletePredictionsRequest.Builder setTypeFilter (TypeFilter typeFilter)

Sets the filter that restricts the type of the results included in the response.

Possible values:

Parameters
typeFilter