类 TextSearchRequest
java.lang.Object
ai.nextbillion.maps.TextSearchRequest
- 所有已实现的接口:
PendingResult<PlacesSearchResponse>
public class TextSearchRequest
extends java.lang.Object
A Text
Search request.
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classTextSearchRequest.Response -
构造器概要
构造器 构造器 说明 TextSearchRequest(GeoApiContext context) -
方法概要
修饰符和类型 方法 说明 Tawait()Performs the request synchronously.TawaitIgnoreError()Performs the request synchronously, ignoring exceptions while performing the request and errors returned by the server.voidcancel()Attempts to cancel the request.Achannel(java.lang.String channel)A channel to pass with the request. channel is used by Google Maps API for Work users to be able to track usage across different applications with the same clientID.Acontext(java.lang.String context)Acustom(java.lang.String parameter, java.lang.String value)Custom parameter.Alanguage(java.lang.String language)The language in which to return results.TextSearchRequestlocation(LatLng location)Specifies the latitude/longitude around which to retrieve place information.TextSearchRequestmaxPrice(PriceLevel priceLevel)Restricts to places that are at most this price level.TextSearchRequestminPrice(PriceLevel priceLevel)Restricts to places that are at least this price level.TextSearchRequestname(java.lang.String name)Specifies one or more terms to be matched against the names of places, separated with space characters.TextSearchRequestopenNow(boolean openNow)Restricts to only those places that are open for business at the time the query is sent.TextSearchRequestpageToken(java.lang.String nextPageToken)Returns the next 20 results from a previously run search.protected Aparam(java.lang.String key, int val)protected Aparam(java.lang.String key, StringJoin.UrlValue val)protected Aparam(java.lang.String key, java.lang.String val)protected AparamAddToList(java.lang.String key, StringJoin.UrlValue val)protected AparamAddToList(java.lang.String key, java.lang.String val)protected java.util.Map<java.lang.String,java.util.List<java.lang.String>>params()TextSearchRequestquery(java.lang.String query)Specifies the text string on which to search, for example:"restaurant".TextSearchRequestradius(int radius)Specifies the distance (in meters) within which to bias place results.TextSearchRequestrankby(RankBy ranking)Specifies the order in which results are listed.TextSearchRequestregion(java.lang.String region)Region used to influence search results.voidsetCallback(PendingResult.Callback<T> callback)TextSearchRequesttype(PlaceType type)Restricts the results to places matching the specified type.protected voidvalidateRequest()
-
构造器详细资料
-
方法详细资料
-
query
Specifies the text string on which to search, for example:"restaurant".- 参数:
query- The query string to search for.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
location
Specifies the latitude/longitude around which to retrieve place information.- 参数:
location- The location of the center of the search.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
region
Region used to influence search results. This parameter will only influence, not fully restrict, search results. If more relevant results exist outside of the specified region, they may be included. When this parameter is used, the country name is omitted from the resulting formatted_address for results in the specified region.- 参数:
region- The ccTLD two-letter code of the region.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
radius
Specifies the distance (in meters) within which to bias place results.- 参数:
radius- The radius of the search bias.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
minPrice
Restricts to places that are at least this price level.- 参数:
priceLevel- The minimum price level to restrict results with.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
maxPrice
Restricts to places that are at most this price level.- 参数:
priceLevel- The maximum price leve to restrict results with.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
name
Specifies one or more terms to be matched against the names of places, separated with space characters.- 参数:
name- The name to search for.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
openNow
Restricts to only those places that are open for business at the time the query is sent.- 参数:
openNow- Whether to restrict this search to open places.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
pageToken
Returns the next 20 results from a previously run search. Setting pageToken will execute a search with the same parameters used previously — all parameters other than pageToken will be ignored.- 参数:
nextPageToken- ApageTokenfrom a prior result.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
rankby
Specifies the order in which results are listed.- 参数:
ranking- The rank by method.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
type
Restricts the results to places matching the specified type.- 参数:
type- The type of place to restrict the results with.- 返回:
- Returns this
TextSearchRequestfor call chaining.
-
validateRequest
protected void validateRequest() -
setCallback
从接口复制的说明:PendingResultPerforms the request asynchronously, callingonResultoronFailureafter the request has been completed.- 指定者:
setCallback在接口中PendingResult<T>- 参数:
callback- The callback to call on completion.
-
await
从接口复制的说明:PendingResultPerforms the request synchronously.- 指定者:
await在接口中PendingResult<T>- 返回:
- The result.
- 抛出:
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.
-
awaitIgnoreError
public final T awaitIgnoreError()从接口复制的说明:PendingResultPerforms the request synchronously, ignoring exceptions while performing the request and errors returned by the server.- 指定者:
awaitIgnoreError在接口中PendingResult<T>- 返回:
- The result, or null if there was any error or exception ignored.
-
cancel
public final void cancel()从接口复制的说明:PendingResultAttempts to cancel the request.- 指定者:
cancel在接口中PendingResult<T>
-
param
protected A param(java.lang.String key, java.lang.String val) -
param
protected A param(java.lang.String key, int val) -
param
-
paramAddToList
protected A paramAddToList(java.lang.String key, java.lang.String val) -
paramAddToList
-
params
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> params() -
language
public final A language(java.lang.String language)The language in which to return results. Note that we often update supported languages so this list may not be exhaustive.- 参数:
language- The language code, e.g. "en-AU" or "es".- 返回:
- Returns the request for call chaining.
- 另请参阅:
- List of supported domain languages
-
channel
public A channel(java.lang.String channel)A channel to pass with the request. channel is used by Google Maps API for Work users to be able to track usage across different applications with the same clientID. See Premium Plan Usage Rates and Limits.- 参数:
channel- String to pass with the request for analytics.- 返回:
- Returns the request for call chaining.
-
custom
public A custom(java.lang.String parameter, java.lang.String value)Custom parameter. For advanced usage only.- 参数:
parameter- The name of the custom parameter.value- The value of the custom parameter.- 返回:
- Returns the request for call chaining.
-
context
public A context(java.lang.String context)
-