类 PlaceAutocompleteRequest

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

public class PlaceAutocompleteRequest
extends java.lang.Object
  • 构造器详细资料

  • 方法详细资料

    • sessionToken

      public PlaceAutocompleteRequest sessionToken​(PlaceAutocompleteRequest.SessionToken sessionToken)
      Sets the SessionToken for this request. Using session token makes sure the autocomplete is priced per session, instead of per keystroke.
      参数:
      sessionToken - Session Token is the session identifier.
      返回:
      Returns this PlaceAutocompleteRequest for call chaining.
    • input

      public PlaceAutocompleteRequest input​(java.lang.String input)
      Sets the text string on which to search. The Places service will return candidate matches based on this string and order results based on their perceived relevance.
      参数:
      input - The input text to autocomplete.
      返回:
      Returns this PlaceAutocompleteRequest for call chaining.
    • offset

      public PlaceAutocompleteRequest offset​(int offset)
      The character position in the input term at which the service uses text for predictions. For example, if the input is 'Googl' and the completion point is 3, the service will match on 'Goo'. The offset should generally be set to the position of the text caret. If no offset is supplied, the service will use the entire term.
      参数:
      offset - The character offset position of the user's cursor.
      返回:
      Returns this PlaceAutocompleteRequest for call chaining.
    • origin

      public PlaceAutocompleteRequest origin​(LatLng origin)
      The origin point from which to calculate straight-line distance to the destination (returned as AutocompletePrediction.distanceMeters). If this value is omitted, straight-line distance will not be returned.
      参数:
      origin - The LatLng origin point from which to calculate distance.
      返回:
      Returns this PlaceAutocompleteRequest for call chaining.
    • location

      public PlaceAutocompleteRequest location​(LatLng location)
      The point around which you wish to retrieve place information.
      参数:
      location - The LatLng location to center this autocomplete search.
      返回:
      Returns this PlaceAutocompleteRequest for call chaining.
    • radius

      public PlaceAutocompleteRequest radius​(int radius)
      The distance (in meters) within which to return place results. Note that setting a radius biases results to the indicated area, but may not fully restrict results to the specified area.
      参数:
      radius - The radius over which to bias results.
      返回:
      Returns this PlaceAutocompleteRequest for call chaining.
    • type

      已过时。
      Please use types instead.
      Restricts the results to places matching the specified type.
      参数:
      type - The type to restrict results to.
      返回:
      Returns this PlaceAutocompleteRequest for call chaining.
    • types

      Restricts the results to places matching the specified type.
      参数:
      types - The type to restrict results to.
      返回:
      Returns this PlaceAutocompleteRequest for call chaining.
    • components

      public PlaceAutocompleteRequest components​(ComponentFilter... filters)
      A grouping of places to which you would like to restrict your results. Currently, you can use components to filter by country.
      参数:
      filters - The component filter to restrict results with.
      返回:
      Returns this PlaceAutocompleteRequest for call chaining.
    • strictBounds

      public PlaceAutocompleteRequest strictBounds​(boolean strictBounds)
      StrictBounds returns only those places that are strictly within the region defined by location and radius. This is a restriction, rather than a bias, meaning that results outside this region will not be returned even if they match the user input.
      参数:
      strictBounds - Whether to strictly bound results.
      返回:
      Returns this PlaceAutocompleteRequest 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)