Package com.google.maps
Interface PendingResult<T>
-
- Type Parameters:
T- the type of the result object.
- All Known Implementing Classes:
DirectionsApiRequest,DistanceMatrixApiRequest,FindPlaceFromTextRequest,GeocodingApiRequest,GeolocationApiRequest,NearbySearchRequest,PhotoRequest,PlaceAutocompleteRequest,PlaceDetailsRequest,QueryAutocompleteRequest,StaticMapsRequest,TextSearchRequest
public interface PendingResult<T>A pending result from an API call.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePendingResult.Callback<T>The callback interface the API client code needs to implement to handle API results.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tawait()Performs the request synchronously.TawaitIgnoreError()Performs the request synchronously, ignoring exceptions while performing the request and errors returned by the server.voidcancel()Attempts to cancel the request.voidsetCallback(PendingResult.Callback<T> callback)
-
-
-
Method Detail
-
setCallback
void setCallback(PendingResult.Callback<T> callback)
Performs the request asynchronously, callingonResultoronFailureafter the request has been completed.- Parameters:
callback- The callback to call on completion.
-
await
T await() throws ApiException, java.lang.InterruptedException, java.io.IOException
Performs the request synchronously.- 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
T awaitIgnoreError()
Performs the request synchronously, ignoring exceptions while performing the request and errors returned by the server.- Returns:
- The result, or null if there was any error or exception ignored.
-
cancel
void cancel()
Attempts to cancel the request.
-
-