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,
HttpHeaders responseHeaders)
Called if the individual batch response is unsuccessful.
|
void |
onSuccess(T t,
HttpHeaders responseHeaders)
Called if the individual batch response is successful.
|
void onSuccess(T t, HttpHeaders responseHeaders) throws IOException
t
- instance of the parsed data model classresponseHeaders
- Headers of the batch responseIOException
void onFailure(E e, HttpHeaders responseHeaders) throws IOException
e
- instance of data class representing the error response contentresponseHeaders
- Headers of the batch responseIOException
Copyright © 2010–2022 Google. All rights reserved.