public class TextSearchRequest
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TextSearchRequest.Response |
PendingResult.Callback<T>
Constructor and Description |
---|
TextSearchRequest(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.
|
A |
custom(java.lang.String parameter,
java.lang.String value)
Custom parameter.
|
A |
language(java.lang.String language)
The language in which to return results.
|
TextSearchRequest |
location(LatLng location)
Specifies the latitude/longitude around which to retrieve place information.
|
TextSearchRequest |
maxPrice(PriceLevel priceLevel)
Restricts to places that are at most this price level.
|
TextSearchRequest |
minPrice(PriceLevel priceLevel)
Restricts to places that are at least this price level.
|
TextSearchRequest |
name(java.lang.String name)
Specifies one or more terms to be matched against the names of places, separated with space
characters.
|
TextSearchRequest |
openNow(boolean openNow)
Restricts to only those places that are open for business at the time the query is sent.
|
TextSearchRequest |
pageToken(java.lang.String nextPageToken)
Returns the next 20 results from a previously run search.
|
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() |
TextSearchRequest |
query(java.lang.String query)
Specifies the text string on which to search, for example:
"restaurant" . |
TextSearchRequest |
radius(int radius)
Specifies the distance (in meters) within which to bias place results.
|
TextSearchRequest |
rankby(RankBy ranking)
Specifies the order in which results are listed.
|
void |
setCallback(PendingResult.Callback<T> callback)
|
TextSearchRequest |
type(PlaceType type)
Restricts the results to places matching the specified type.
|
protected void |
validateRequest() |
public TextSearchRequest(GeoApiContext context)
public TextSearchRequest query(java.lang.String query)
"restaurant"
.query
- The query string to search for.TextSearchRequest
for call chaining.public TextSearchRequest location(LatLng location)
location
- The location of the center of the search.TextSearchRequest
for call chaining.public TextSearchRequest radius(int radius)
radius
- The radius of the search bias.TextSearchRequest
for call chaining.public TextSearchRequest minPrice(PriceLevel priceLevel)
priceLevel
- The minimum price level to restrict results with.TextSearchRequest
for call chaining.public TextSearchRequest maxPrice(PriceLevel priceLevel)
priceLevel
- The maximum price leve to restrict results with.TextSearchRequest
for call chaining.public TextSearchRequest name(java.lang.String name)
name
- The name to search for.TextSearchRequest
for call chaining.public TextSearchRequest openNow(boolean openNow)
openNow
- Whether to restrict this search to open places.TextSearchRequest
for call chaining.public TextSearchRequest pageToken(java.lang.String nextPageToken)
nextPageToken
- A pageToken
from a prior result.TextSearchRequest
for call chaining.public TextSearchRequest rankby(RankBy ranking)
ranking
- The rank by method.TextSearchRequest
for call chaining.public TextSearchRequest type(PlaceType type)
type
- The type of place to restrict the results with.TextSearchRequest
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.