T - Type of the data model classE - Type of the error data model classpublic interface BatchCallback<T,E>
Sample use:
batch.queue(volumesList.buildHttpRequest(), Volumes.class, GoogleJsonErrorContainer.class,
new BatchCallback<Volumes, GoogleJsonErrorContainer>() {
public void onSuccess(Volumes volumes, HttpHeaders responseHeaders) {
log("Success");
printVolumes(volumes.getItems());
}
public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) {
log(e.getError().getMessage());
}
});
| Modifier and Type | Method and Description |
|---|---|
void |
onFailure(E e,
com.google.api.client.http.HttpHeaders responseHeaders)
Called if the individual batch response is unsuccessful.
|
void |
onSuccess(T t,
com.google.api.client.http.HttpHeaders responseHeaders)
Called if the individual batch response is successful.
|
void onSuccess(T t, com.google.api.client.http.HttpHeaders responseHeaders) throws java.io.IOException
t - instance of the parsed data model classresponseHeaders - Headers of the batch responsejava.io.IOExceptionvoid onFailure(E e, com.google.api.client.http.HttpHeaders responseHeaders) throws java.io.IOException
e - instance of data class representing the error response contentresponseHeaders - Headers of the batch responsejava.io.IOExceptionCopyright © 2010-2018 Google. All Rights Reserved.