public class NearbySearchRequest
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
NearbySearchRequest.Response |
PendingResult.Callback<T>
Constructor and Description |
---|
NearbySearchRequest(GeoApiContext context)
Constructor for
NearbySearchRequest . |
Modifier and Type | Method and Description |
---|---|
T |
await()
Performs the GET request synchronously.
|
T |
awaitIgnoreError()
Performs the request synchronously, ignoring exceptions while performing the request and errors
returned by the server.
|
void |
cancel()
Attempt 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)
keyword is a term to be matched against all content that Google has indexed for this place,
including but not limited to name, type, and address, as well as customer reviews and other
third-party content.
|
A |
language(java.lang.String language)
The language in which to return results.
|
NearbySearchRequest |
location(LatLng location)
location is the latitude/longitude around which to retrieve place information.
|
NearbySearchRequest |
maxPrice(PriceLevel priceLevel)
maxPrice restricts to places that are at most this price level.
|
NearbySearchRequest |
minPrice(PriceLevel priceLevel)
minPrice restricts to places that are at least this price level.
|
NearbySearchRequest |
name(java.lang.String name)
name is one or more terms to be matched against the names of places, separated with a space
character.
|
NearbySearchRequest |
openNow(boolean openNow)
openNow returns only those places that are open for business at the time the query is sent.
|
NearbySearchRequest |
pageToken(java.lang.String nextPageToken)
nextPageToken returns the next 20 results from a previously run search.
|
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 java.util.Map<java.lang.String,java.lang.String> |
params() |
NearbySearchRequest |
radius(int distance)
radius defines the distance (in meters) within which to return place results.
|
NearbySearchRequest |
rankby(RankBy ranking)
rankby specifies the order in which results are listed.
|
void |
setCallback(PendingResult.Callback<T> callback)
Performs the request asynchronously, calling onResult or onFailure after the request has been
completed.
|
NearbySearchRequest |
type(PlaceType... types)
type restricts the results to places matching the specified type.
|
NearbySearchRequest |
type(PlaceType type)
type restricts the results to places matching the specified type.
|
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)
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)
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.public NearbySearchRequest type(PlaceType... types)
types
- The PlaceType
s to restrict results to.NearbyApiRequest
for call chaining.protected void validateRequest()
public final void setCallback(PendingResult.Callback<T> callback)
PendingResult
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, com.google.maps.internal.StringJoin.UrlValue val)
protected java.util.Map<java.lang.String,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 analyticspublic A custom(java.lang.String parameter, java.lang.String value)
parameter
- The name of the custom parameter.value
- The value of the custom parameter.