Package com.google.maps
Class PlaceDetailsRequest
- java.lang.Object
-
- com.google.maps.PlaceDetailsRequest
-
- All Implemented Interfaces:
PendingResult<PlaceDetails>
public class PlaceDetailsRequest extends java.lang.Object
A Place Details request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PlaceDetailsRequest.FieldMask
static class
PlaceDetailsRequest.Response
-
Nested classes/interfaces inherited from interface com.google.maps.PendingResult
PendingResult.Callback<T>
-
-
Constructor Summary
Constructors Constructor Description PlaceDetailsRequest(GeoApiContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.A
custom(java.lang.String parameter, java.lang.String value)
Custom parameter.PlaceDetailsRequest
fields(PlaceDetailsRequest.FieldMask... fields)
Specifies the field masks of the details to be returned by PlaceDetails.A
language(java.lang.String language)
The language in which to return results.protected A
param(java.lang.String key, int val)
protected A
param(java.lang.String key, com.google.maps.internal.StringJoin.UrlValue val)
protected A
param(java.lang.String key, java.lang.String val)
protected A
paramAddToList(java.lang.String key, com.google.maps.internal.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()
PlaceDetailsRequest
placeId(java.lang.String placeId)
Specifies the Place ID to get Place Details for.PlaceDetailsRequest
region(java.lang.String region)
Sets the Region for this request.PlaceDetailsRequest
sessionToken(PlaceAutocompleteRequest.SessionToken sessionToken)
Sets the SessionToken for this request.void
setCallback(PendingResult.Callback<T> callback)
protected void
validateRequest()
-
-
-
Constructor Detail
-
PlaceDetailsRequest
public PlaceDetailsRequest(GeoApiContext context)
-
-
Method Detail
-
placeId
public PlaceDetailsRequest placeId(java.lang.String placeId)
Specifies the Place ID to get Place Details for. Required.- Parameters:
placeId
- The Place ID to retrieve details for.- Returns:
- Returns this
PlaceDetailsRequest
for call chaining.
-
sessionToken
public PlaceDetailsRequest sessionToken(PlaceAutocompleteRequest.SessionToken sessionToken)
Sets the SessionToken for this request. Use this for Place Details requests that are called following an autocomplete request in the same user session. Optional.- Parameters:
sessionToken
- Session Token is the session identifier.- Returns:
- Returns this
PlaceDetailsRequest
for call chaining.
-
region
public PlaceDetailsRequest region(java.lang.String region)
Sets the Region for this request. The region code, specified as a ccTLD (country code top-level domain) two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some exceptions. This parameter will only influence, not fully restrict, results.- Parameters:
region
- The region code.- Returns:
- Returns this
PlaceDetailsRequest
for call chaining.
-
fields
public PlaceDetailsRequest fields(PlaceDetailsRequest.FieldMask... fields)
Specifies the field masks of the details to be returned by PlaceDetails.- Parameters:
fields
- The Field Masks of the fields to return.- Returns:
- Returns this
PlaceDetailsRequest
for call chaining.
-
validateRequest
protected void validateRequest()
-
setCallback
public final void setCallback(PendingResult.Callback<T> callback)
Description copied from interface:PendingResult
Performs the request asynchronously, callingonResult
oronFailure
after the request has been completed.- Specified by:
setCallback
in interfacePendingResult<T>
- Parameters:
callback
- The callback to call on completion.
-
await
public final T await() throws ApiException, java.lang.InterruptedException, java.io.IOException
Description copied from interface:PendingResult
Performs the request synchronously.- Specified by:
await
in interfacePendingResult<T>
- Returns:
- The result.
- Throws:
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()
Description copied from interface:PendingResult
Performs the request synchronously, ignoring exceptions while performing the request and errors returned by the server.- Specified by:
awaitIgnoreError
in interfacePendingResult<T>
- Returns:
- The result, or null if there was any error or exception ignored.
-
cancel
public final void cancel()
Description copied from interface:PendingResult
Attempts to cancel the request.- Specified by:
cancel
in interfacePendingResult<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, com.google.maps.internal.StringJoin.UrlValue val)
-
paramAddToList
protected A paramAddToList(java.lang.String key, java.lang.String val)
-
paramAddToList
protected A paramAddToList(java.lang.String key, com.google.maps.internal.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.- Parameters:
language
- The language code, e.g. "en-AU" or "es".- Returns:
- Returns the request for call chaining.
- See Also:
- 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.- Parameters:
channel
- String to pass with the request for analytics.- Returns:
- Returns the request for call chaining.
-
custom
public A custom(java.lang.String parameter, java.lang.String value)
Custom parameter. For advanced usage only.- Parameters:
parameter
- The name of the custom parameter.value
- The value of the custom parameter.- Returns:
- Returns the request for call chaining.
-
-