PendingResult<PlacesSearchResponse>public class NearbySearchRequest
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
NearbySearchRequest.Response |
PendingResult.Callback<T>| Constructor | Description |
|---|---|
NearbySearchRequest(GeoApiContext context) |
Constructs a new
NearbySearchRequest. |
| Modifier and Type | Method | 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.
|
NearbySearchRequest |
keyword(java.lang.String keyword) |
Specifies a term to be matched against all content that Google has indexed for this place.
|
A |
language(java.lang.String language) |
The language in which to return results.
|
NearbySearchRequest |
location(LatLng location) |
Specifies the latitude/longitude around which to retrieve place information.
|
NearbySearchRequest |
maxPrice(PriceLevel priceLevel) |
Restricts to places that are at most this price level.
|
NearbySearchRequest |
minPrice(PriceLevel priceLevel) |
Restricts to places that are at least this price level.
|
NearbySearchRequest |
name(java.lang.String name) |
Specifies one or more terms to be matched against the names of places, separated by spaces.
|
NearbySearchRequest |
openNow(boolean openNow) |
Restricts to only those places that are open for business at the time the query is sent.
|
NearbySearchRequest |
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,
com.google.maps.internal.StringJoin.UrlValue val) |
|
protected A |
param(java.lang.String key,
java.lang.String val) |
|
protected A |
paramAddToList(java.lang.String key,
com.google.maps.internal.StringJoin.UrlValue val) |
|
protected A |
paramAddToList(java.lang.String key,
java.lang.String val) |
|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
params() |
|
NearbySearchRequest |
radius(int distance) |
Specifies the distance (in meters) within which to return place results.
|
NearbySearchRequest |
rankby(RankBy ranking) |
Specifies the order in which results are listed.
|
void |
setCallback(PendingResult.Callback<T> callback) |
|
NearbySearchRequest |
type(PlaceType type) |
Restricts the results to places matching the specified type.
|
NearbySearchRequest |
type(PlaceType... types) |
Deprecated.
Multiple search types are ignored by the Places API.
|
protected void |
validateRequest() |
public NearbySearchRequest(GeoApiContext context)
NearbySearchRequest.context - The GeoApiContext to make requests through.public NearbySearchRequest location(LatLng location)
location - The location to use as the center of the Nearby Search.NearbyApiRequest for call chaining.public NearbySearchRequest radius(int distance)
rankby=DISTANCE is
specified.distance - The distance in meters around the location(LatLng) to search.NearbyApiRequest for call chaining.public NearbySearchRequest rankby(RankBy ranking)
ranking - The rank by method.NearbyApiRequest for call chaining.public NearbySearchRequest keyword(java.lang.String keyword)
keyword - The keyword to search for.NearbyApiRequest for call chaining.public NearbySearchRequest minPrice(PriceLevel priceLevel)
priceLevel - The price level to set as minimum.NearbyApiRequest for call chaining.public NearbySearchRequest maxPrice(PriceLevel priceLevel)
priceLevel - The price level to set as maximum.NearbyApiRequest for call chaining.public NearbySearchRequest name(java.lang.String name)
name - Search for Places with this name.NearbyApiRequest for call chaining.public NearbySearchRequest openNow(boolean openNow)
openNow - Whether to restrict to places that are open.NearbyApiRequest for call chaining.public NearbySearchRequest pageToken(java.lang.String nextPageToken)
pageToken will
execute a search with the same parameters used previously — all parameters other than
pageToken will be ignored.nextPageToken - The page token from a previous result.NearbyApiRequest for call chaining.public NearbySearchRequest type(PlaceType type)
type - The PlaceType to restrict results to.NearbyApiRequest for call chaining.@Deprecated public NearbySearchRequest type(PlaceType... types)
types - The PlaceTypes to restrict results to.NearbyApiRequest for call chaining.protected void validateRequest()
public final void setCallback(PendingResult.Callback<T> callback)
PendingResultonResult 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
PendingResultawait 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()
PendingResultawaitIgnoreError in interface PendingResult<T>public final void cancel()
PendingResultcancel 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.