类 NearbySearchRequest

java.lang.Object
ai.nextbillion.maps.NearbySearchRequest
所有已实现的接口:
PendingResult<PlacesSearchResponse>

public class NearbySearchRequest
extends java.lang.Object
A Nearby Search request.
  • 嵌套类概要

    嵌套类 
    修饰符和类型 说明
    static class  NearbySearchRequest.Response  

    从接口继承的嵌套类/接口 ai.nextbillion.maps.PendingResult

    PendingResult.Callback<T>
  • 构造器概要

    构造器 
    构造器 说明
    NearbySearchRequest​(GeoApiContext context)
    Constructs a new NearbySearchRequest.
  • 方法概要

    修饰符和类型 方法 说明
    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. channel is used by Google Maps API for Work users to be able to track usage across different applications with the same clientID.
    A context​(java.lang.String context)  
    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, StringJoin.UrlValue val)  
    protected A param​(java.lang.String key, java.lang.String val)  
    protected A paramAddToList​(java.lang.String key, 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)
    Performs the request asynchronously, calling onResult or onFailure after the request has been completed.
    NearbySearchRequest type​(PlaceType type)
    Restricts the results to places matching the specified type.
    NearbySearchRequest type​(PlaceType... types)
    已过时。
    Multiple search types are ignored by the Places API.
    protected void validateRequest()  

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • NearbySearchRequest

      public NearbySearchRequest​(GeoApiContext context)
      Constructs a new NearbySearchRequest.
      参数:
      context - The GeoApiContext to make requests through.
  • 方法详细资料

    • location

      public NearbySearchRequest location​(LatLng location)
      Specifies the latitude/longitude around which to retrieve place information.
      参数:
      location - The location to use as the center of the Nearby Search.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • radius

      public NearbySearchRequest radius​(int distance)
      Specifies the distance (in meters) within which to return place results. The maximum allowed radius is 50,000 meters. Note that radius must not be included if rankby=DISTANCE is specified.
      参数:
      distance - The distance in meters around the location(LatLng) to search.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • rankby

      public NearbySearchRequest rankby​(RankBy ranking)
      Specifies the order in which results are listed.
      参数:
      ranking - The rank by method.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • keyword

      public NearbySearchRequest keyword​(java.lang.String keyword)
      Specifies a term to be matched against all content that Google has indexed for this place. This includes but is not limited to name, type, and address, as well as customer reviews and other third-party content.
      参数:
      keyword - The keyword to search for.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • minPrice

      public NearbySearchRequest minPrice​(PriceLevel priceLevel)
      Restricts to places that are at least this price level.
      参数:
      priceLevel - The price level to set as minimum.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • maxPrice

      public NearbySearchRequest maxPrice​(PriceLevel priceLevel)
      Restricts to places that are at most this price level.
      参数:
      priceLevel - The price level to set as maximum.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • name

      public NearbySearchRequest name​(java.lang.String name)
      Specifies one or more terms to be matched against the names of places, separated by spaces.
      参数:
      name - Search for Places with this name.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • openNow

      public NearbySearchRequest openNow​(boolean openNow)
      Restricts to only those places that are open for business at the time the query is sent.
      参数:
      openNow - Whether to restrict to places that are open.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • pageToken

      public NearbySearchRequest pageToken​(java.lang.String nextPageToken)
      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 - The page token from a previous result.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • type

      public NearbySearchRequest type​(PlaceType type)
      Restricts the results to places matching the specified type.
      参数:
      type - The PlaceType to restrict results to.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • type

      @Deprecated public NearbySearchRequest type​(PlaceType... types)
      已过时。
      Multiple search types are ignored by the Places API.
      Restricts the results to places matching the specified type. Provides support for multiple types.
      参数:
      types - The PlaceTypes to restrict results to.
      返回:
      Returns this NearbyApiRequest for call chaining.
    • validateRequest

      protected void validateRequest()
    • setCallback

      public final void setCallback​(PendingResult.Callback<T> callback)
      从接口复制的说明: PendingResult
      Performs the request asynchronously, calling onResult or onFailure after the request has been completed.
      指定者:
      setCallback 在接口中 PendingResult<T>
      参数:
      callback - The callback to call on completion.
    • await

      public final T await() throws ApiException, java.lang.InterruptedException, java.io.IOException
      从接口复制的说明: PendingResult
      Performs 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()
      从接口复制的说明: PendingResult
      Performs 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()
      从接口复制的说明: PendingResult
      Attempts 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

      protected A param​(java.lang.String key, StringJoin.UrlValue val)
    • paramAddToList

      protected A paramAddToList​(java.lang.String key, java.lang.String val)
    • paramAddToList

      protected A paramAddToList​(java.lang.String key, StringJoin.UrlValue val)
    • 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)