Package com.google.maps
Class GeolocationApiRequest
- java.lang.Object
-
- com.google.maps.GeolocationApiRequest
-
- All Implemented Interfaces:
PendingResult<GeolocationResult>
public class GeolocationApiRequest extends java.lang.Object
A request for the Geolocation API.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.maps.PendingResult
PendingResult.Callback<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeolocationApiRequest
AddCellTower(CellTower newCellTower)
GeolocationApiRequest
AddWifiAccessPoint(WifiAccessPoint newWifiAccessPoint)
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.GeolocationApiRequest
Carrier(java.lang.String newCarrier)
GeolocationApiRequest
CellTowers(CellTower[] newCellTowers)
A
channel(java.lang.String channel)
A channel to pass with the request.GeolocationApiRequest
ConsiderIp(boolean newConsiderIp)
GeolocationApiRequest
CreatePayload()
A
custom(java.lang.String parameter, java.lang.String value)
Custom parameter.GeolocationApiRequest
HomeMobileCountryCode(int newHomeMobileCountryCode)
GeolocationApiRequest
HomeMobileNetworkCode(int newHomeMobileNetworkCode)
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()
GeolocationApiRequest
Payload(GeolocationPayload payload)
GeolocationApiRequest
RadioType(java.lang.String newRadioType)
void
setCallback(PendingResult.Callback<T> callback)
protected void
validateRequest()
GeolocationApiRequest
WifiAccessPoints(WifiAccessPoint[] newWifiAccessPoints)
-
-
-
Method Detail
-
validateRequest
protected void validateRequest()
-
HomeMobileCountryCode
public GeolocationApiRequest HomeMobileCountryCode(int newHomeMobileCountryCode)
-
HomeMobileNetworkCode
public GeolocationApiRequest HomeMobileNetworkCode(int newHomeMobileNetworkCode)
-
RadioType
public GeolocationApiRequest RadioType(java.lang.String newRadioType)
-
Carrier
public GeolocationApiRequest Carrier(java.lang.String newCarrier)
-
ConsiderIp
public GeolocationApiRequest ConsiderIp(boolean newConsiderIp)
-
CellTowers
public GeolocationApiRequest CellTowers(CellTower[] newCellTowers)
-
AddCellTower
public GeolocationApiRequest AddCellTower(CellTower newCellTower)
-
WifiAccessPoints
public GeolocationApiRequest WifiAccessPoints(WifiAccessPoint[] newWifiAccessPoints)
-
AddWifiAccessPoint
public GeolocationApiRequest AddWifiAccessPoint(WifiAccessPoint newWifiAccessPoint)
-
Payload
public GeolocationApiRequest Payload(GeolocationPayload payload)
-
CreatePayload
public GeolocationApiRequest CreatePayload()
-
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.
-
-