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 AutocompletePrediction.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()
This method is deprecated. Use setTypesFilter(List) and getTypesFilter() instead.
abstract List<String>
getTypesFilter()
Gets the filter that restricts the type(s) of results returned from 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)
This method is deprecated. Use setCountries(List) instead.
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 AutocompletePrediction.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)
This method is deprecated. Use setTypesFilter(List) instead.
abstract FindAutocompletePredictionsRequest.Builder
setTypesFilter(List<String> placeTypes)
Sets the filter that restricts the type(s) of results returned from the response.

Inherited Method Summary

Public Constructors

public 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 AutocompletePrediction.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 ()

This method is deprecated.
Use setTypesFilter(List) and getTypesFilter() instead.

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

Possible values:

public abstract List<String> getTypesFilter ()

Gets the filter that restricts the type(s) of results returned from the response.

A comprehensive list of the supported types can be found in PlaceTypes.

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)

This method is deprecated.
Use setCountries(List) instead.

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 AutocompletePrediction.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)

This method is deprecated.
Use setTypesFilter(List) instead.

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

Possible values:

This property will be ignored if typesFilter is set using setTypesFilter(List)}.

Parameters
typeFilter

public abstract FindAutocompletePredictionsRequest.Builder setTypesFilter (List<String> placeTypes)

Sets the filter that restricts the type(s) of results returned from the response.

Up to 5 place types are supported. A comprehensive list of the supported types can be found in PlaceTypes. The type collections specified in table 3 must be passed in as solo entries and cannot be combined with any other entries from table 1 or 2.

This will override setTypeFilter(TypeFilter) if both are used.

Parameters
placeTypes a list of PlaceTypes