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 Integer
getInputOffset()
Gets the zero-based Unicode character offset indicating the cursor position in the query.
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 String
getRegionCode()
Gets the region code specified as a CLDR two-character region code.
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
setInputOffset(Integer inputOffset)
Sets the zero-based Unicode character offset indicating the cursor position in the query.
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
setRegionCode(String regionCode)
Sets the region code specified as a CLDR two-character region code.
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, up to 5 place types are supported.

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 Integer getInputOffset ()

Gets the zero-based Unicode character offset indicating the cursor position in the query.

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 String getRegionCode ()

Gets the region code specified as a CLDR two-character region code.

Specified as a CLDR two-character region code. This affects address formatting, result ranking, and may influence what results are returned.

This does not restrict results to the specified region. To restrict results to a region use countries or LocationRestriction

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.

If you enable Places API then 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.

If you enable Places API (New), then types passed here are treated as primary types.

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 setInputOffset (Integer inputOffset)

Sets the zero-based Unicode character offset indicating the cursor position in the query.

Parameters
inputOffset

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.

The supported LocationBias type is based on which API version you are using.

If you enable Places API (New), then both RectangularBounds and CircularBounds are supported.

If you enable Places API, then only RectangularBounds is supported.

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.

The supported LocationRestriction type is based on which API version you are using.

If you enable Places API (New), then both RectangularBounds and CircularBounds are supported.

If you enable Places API, then only RectangularBounds is supported.

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 setRegionCode (String regionCode)

Sets the region code specified as a CLDR two-character region code.

Specified as a CLDR two-character region code. This affects address formatting, result ranking, and may influence what results are returned.

This does not restrict results to the specified region. To restrict results to a region use countries or LocationRestriction

Parameters
regionCode

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.

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

If you enable Places API then 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.

If you enable Places API (New), then types passed here are treated as primary types.

Parameters
placeTypes a list of PlaceTypes