public class PhotoRequest
extends java.lang.Object
PendingResult.Callback<T>
Constructor and Description |
---|
PhotoRequest(GeoApiContext context) |
Modifier and Type | Method and 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.
|
A |
language(java.lang.String language)
The language in which to return results.
|
PhotoRequest |
maxHeight(int maxHeight)
Sets the maxHeight for this request.
|
PhotoRequest |
maxWidth(int maxWidth)
Sets the maxWidth for this request.
|
protected A |
param(java.lang.String key,
int val) |
protected A |
param(java.lang.String key,
java.lang.String val) |
protected A |
param(java.lang.String key,
com.google.maps.internal.StringJoin.UrlValue val) |
protected A |
paramAddToList(java.lang.String key,
java.lang.String val) |
protected A |
paramAddToList(java.lang.String key,
com.google.maps.internal.StringJoin.UrlValue val) |
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
params() |
PhotoRequest |
photoReference(java.lang.String photoReference)
Sets the photoReference for this request.
|
void |
setCallback(PendingResult.Callback<T> callback)
|
protected void |
validateRequest() |
public PhotoRequest(GeoApiContext context)
protected void validateRequest()
public PhotoRequest photoReference(java.lang.String photoReference)
photoReference
- A string identifier that uniquely identifies a photo. Photo references
are returned from either a Place Search or Place Details request.public PhotoRequest maxHeight(int maxHeight)
maxHeight
- The maximum desired height, in pixels, of the image returned by the Place
Photos service.public PhotoRequest maxWidth(int maxWidth)
maxWidth
- The maximum desired width, in pixels, of the image returned by the Place Photos
service.public final void setCallback(PendingResult.Callback<T> callback)
PendingResult
onResult
or onFailure
after the request has been
completed.setCallback
in interface PendingResult<T>
callback
- The callback to call on completion.public final T await() throws ApiException, java.lang.InterruptedException, java.io.IOException
PendingResult
await
in interface PendingResult<T>
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.public final T awaitIgnoreError()
PendingResult
awaitIgnoreError
in interface PendingResult<T>
public final void cancel()
PendingResult
cancel
in interface PendingResult<T>
protected A param(java.lang.String key, java.lang.String val)
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 paramAddToList(java.lang.String key, java.lang.String val)
protected A paramAddToList(java.lang.String key, com.google.maps.internal.StringJoin.UrlValue val)
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> params()
public final A language(java.lang.String language)
language
- The language code, e.g. "en-AU" or "es".public A channel(java.lang.String channel)
channel
- String to pass with the request for analytics.public A custom(java.lang.String parameter, java.lang.String value)
parameter
- The name of the custom parameter.value
- The value of the custom parameter.