public class PlaceAutocompleteRequest
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PlaceAutocompleteRequest.Response |
static class |
PlaceAutocompleteRequest.SessionToken
SessionToken represents an Autocomplete session.
|
PendingResult.Callback<T>
Modifier | Constructor and Description |
---|---|
protected |
PlaceAutocompleteRequest(GeoApiContext context) |
Modifier and Type | Method and Description |
---|---|
T |
await()
Performs the request synchronously.
|
T |
awaitIgnoreError()
Performs the request synchronously, ignoring exceptions while performing the request and errors
returned by the server.
|
void |
cancel()
Attempts to cancel the request.
|
A |
channel(java.lang.String channel)
A channel to pass with the request.
|
PlaceAutocompleteRequest |
components(ComponentFilter... filters)
A grouping of places to which you would like to restrict your results.
|
A |
custom(java.lang.String parameter,
java.lang.String value)
Custom parameter.
|
PlaceAutocompleteRequest |
input(java.lang.String input)
Sets the text string on which to search.
|
A |
language(java.lang.String language)
The language in which to return results.
|
PlaceAutocompleteRequest |
location(LatLng location)
The point around which you wish to retrieve place information.
|
PlaceAutocompleteRequest |
offset(int offset)
The character position in the input term at which the service uses text for predictions.
|
protected A |
param(java.lang.String key,
int val) |
protected A |
param(java.lang.String key,
java.lang.String val) |
protected A |
param(java.lang.String key,
com.google.maps.internal.StringJoin.UrlValue val) |
protected A |
paramAddToList(java.lang.String key,
java.lang.String val) |
protected A |
paramAddToList(java.lang.String key,
com.google.maps.internal.StringJoin.UrlValue val) |
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
params() |
PlaceAutocompleteRequest |
radius(int radius)
The distance (in meters) within which to return place results.
|
PlaceAutocompleteRequest |
sessionToken(PlaceAutocompleteRequest.SessionToken sessionToken)
Sets the SessionToken for this request.
|
void |
setCallback(PendingResult.Callback<T> callback)
|
PlaceAutocompleteRequest |
strictBounds(boolean strictBounds)
StrictBounds returns only those places that are strictly within the region defined by location
and radius.
|
PlaceAutocompleteRequest |
type(PlaceAutocompleteType type)
Deprecated.
Please use
types instead. |
PlaceAutocompleteRequest |
types(PlaceAutocompleteType types)
Restricts the results to places matching the specified type.
|
protected void |
validateRequest() |
protected PlaceAutocompleteRequest(GeoApiContext context)
public PlaceAutocompleteRequest sessionToken(PlaceAutocompleteRequest.SessionToken sessionToken)
sessionToken
- Session Token is the session identifier.PlaceAutocompleteRequest
for call chaining.public PlaceAutocompleteRequest input(java.lang.String input)
input
- The input text to autocomplete.PlaceAutocompleteRequest
for call chaining.public PlaceAutocompleteRequest offset(int offset)
offset
- The character offset position of the user's cursor.PlaceAutocompleteRequest
for call chaining.public PlaceAutocompleteRequest location(LatLng location)
location
- The LatLng
location to center this autocomplete search.PlaceAutocompleteRequest
for call chaining.public PlaceAutocompleteRequest radius(int radius)
radius
- The radius over which to bias results.PlaceAutocompleteRequest
for call chaining.public PlaceAutocompleteRequest type(PlaceAutocompleteType type)
types
instead.type
- The type to restrict results to.PlaceAutocompleteRequest
for call chaining.public PlaceAutocompleteRequest types(PlaceAutocompleteType types)
types
- The type to restrict results to.PlaceAutocompleteRequest
for call chaining.public PlaceAutocompleteRequest components(ComponentFilter... filters)
filters
- The component filter to restrict results with.PlaceAutocompleteRequest
for call chaining.public PlaceAutocompleteRequest strictBounds(boolean strictBounds)
strictBounds
- Whether to strictly bound results.PlaceAutocompleteRequest
for call chaining.protected void validateRequest()
public final void setCallback(PendingResult.Callback<T> callback)
PendingResult
onResult
or onFailure
after the request has been
completed.setCallback
in interface PendingResult<T>
callback
- The callback to call on completion.public final T await() throws ApiException, java.lang.InterruptedException, java.io.IOException
PendingResult
await
in interface PendingResult<T>
ApiException
- Thrown if the API Returned result is an error.java.lang.InterruptedException
- Thrown when a thread is waiting, sleeping, or otherwise occupied,
and the thread is interrupted.java.io.IOException
- Thrown when an I/O exception of some sort has occurred.public final T awaitIgnoreError()
PendingResult
awaitIgnoreError
in interface PendingResult<T>
public final void cancel()
PendingResult
cancel
in interface PendingResult<T>
protected A param(java.lang.String key, java.lang.String val)
protected A param(java.lang.String key, int val)
protected A param(java.lang.String key, com.google.maps.internal.StringJoin.UrlValue val)
protected A paramAddToList(java.lang.String key, java.lang.String val)
protected A paramAddToList(java.lang.String key, com.google.maps.internal.StringJoin.UrlValue val)
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> params()
public final A language(java.lang.String language)
language
- The language code, e.g. "en-AU" or "es".public A channel(java.lang.String channel)
channel
- String to pass with the request for analytics.public A custom(java.lang.String parameter, java.lang.String value)
parameter
- The name of the custom parameter.value
- The value of the custom parameter.