类 GeocodingApiRequest

java.lang.Object
ai.nextbillion.maps.GeocodingApiRequest
所有已实现的接口:
PendingResult<java.lang.String[]>

public class GeocodingApiRequest
extends java.lang.Object
A request for the Geocoding API.
  • 嵌套类概要

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

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

    构造器 
    构造器 说明
    GeocodingApiRequest​(GeoApiContext context)  
  • 方法概要

    修饰符和类型 方法 说明
    GeocodingApiRequest address​(java.lang.String address)
    Creates a forward geocode for address.
    T await()
    Performs the request synchronously.
    T awaitIgnoreError()
    Performs the request synchronously, ignoring exceptions while performing the request and errors returned by the server.
    GeocodingApiRequest bounds​(LatLng southWestBound, LatLng northEastBound)
    Sets the bounding box of the viewport within which to bias geocode results more prominently.
    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.
    GeocodingApiRequest components​(ComponentFilter... filters)
    Sets the component filters.
    A context​(java.lang.String context)  
    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.
    GeocodingApiRequest latlng​(LatLng latlng)
    Creates a reverse geocode for latlng.
    GeocodingApiRequest locationType​(LocationType... locationTypes)
    Sets the location type.
    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()  
    GeocodingApiRequest place​(java.lang.String placeId)
    Creates a forward geocode for placeId.
    GeocodingApiRequest region​(java.lang.String region)
    Sets the region code, specified as a ccTLD ("top-level domain") two-character value.
    GeocodingApiRequest resultType​(AddressType... resultTypes)
    Sets the result type.
    void setCallback​(PendingResult.Callback<T> callback)
    Performs the request asynchronously, calling onResult or onFailure after the request has been completed.
    protected void validateRequest()  

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

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

  • 方法详细资料

    • validateRequest

      protected void validateRequest()
    • address

      public GeocodingApiRequest address​(java.lang.String address)
      Creates a forward geocode for address.
      参数:
      address - The address to geocode.
      返回:
      Returns this GeocodingApiRequest for call chaining.
    • place

      public GeocodingApiRequest place​(java.lang.String placeId)
      Creates a forward geocode for placeId.
      参数:
      placeId - The Place ID to geocode.
      返回:
      Returns this GeocodingApiRequest for call chaining.
    • latlng

      public GeocodingApiRequest latlng​(LatLng latlng)
      Creates a reverse geocode for latlng.
      参数:
      latlng - The location to reverse geocode.
      返回:
      Returns this GeocodingApiRequest for call chaining.
    • bounds

      public GeocodingApiRequest bounds​(LatLng southWestBound, LatLng northEastBound)
      Sets the bounding box of the viewport within which to bias geocode results more prominently. This parameter will only influence, not fully restrict, results from the geocoder.

      For more information see Viewport Biasing.

      参数:
      southWestBound - The South West bound of the bounding box.
      northEastBound - The North East bound of the bounding box.
      返回:
      Returns this GeocodingApiRequest for call chaining.
    • region

      public GeocodingApiRequest region​(java.lang.String region)
      Sets the region code, specified as a ccTLD ("top-level domain") two-character value. This parameter will only influence, not fully restrict, results from the geocoder.

      For more information see Region Biasing.

      参数:
      region - The region code to influence results.
      返回:
      Returns this GeocodingApiRequest for call chaining.
    • components

      public GeocodingApiRequest components​(ComponentFilter... filters)
      Sets the component filters. Each component filter consists of a component:value pair and will fully restrict the results from the geocoder.

      For more information see Component Filtering.

      参数:
      filters - Component filters to apply to the request.
      返回:
      Returns this GeocodingApiRequest for call chaining.
    • resultType

      public GeocodingApiRequest resultType​(AddressType... resultTypes)
      Sets the result type. Specifying a type will restrict the results to this type. If multiple types are specified, the API will return all addresses that match any of the types.
      参数:
      resultTypes - The result types to restrict to.
      返回:
      Returns this GeocodingApiRequest for call chaining.
    • locationType

      public GeocodingApiRequest locationType​(LocationType... locationTypes)
      Sets the location type. Specifying a type will restrict the results to this type. If multiple types are specified, the API will return all addresses that match any of the types.
      参数:
      locationTypes - The location types to restrict to.
      返回:
      Returns this GeocodingApiRequest for call chaining.
    • 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)