public class Future<T> extends Object implements Serializable
Future contains :
Request used to call the Diffbot API and obtain a resultDiffbotAPI that created this Future. It is used to trigger the batch
API call.T result representing the result of the call corresponding to the Request.DiffbotException if the call resulted in an error. If an DiffbotException exist it will be
thrown when trying to access the result.| Modifier | Constructor and Description |
|---|---|
protected |
Future(Request request,
DiffbotAPI callback)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
T |
get()
If a batch request containing the
Request of this Future has already been executed, return the
result obtained. |
protected Request |
getRequest() |
protected Future<T> |
setError(DiffbotException error) |
protected Future<T> |
setExecuted(boolean executed) |
protected Future<T> |
setResult(T result) |
protected Future(Request request, DiffbotAPI callback)
request - Request used to call the Diffbot API and obtain a resultcallback - a reference to the DiffbotAPI that created this Futureprotected final Request getRequest()
protected final Future<T> setError(DiffbotException error)
public final T get() throws DiffbotAPIException, DiffbotIOException, DiffbotUnauthorizedException, DiffbotServerException, DiffbotParseException
Request of this Future has already been executed, return the
result obtained. If not, executes the batch request and returns the result for the Request of this
Future.Article or Frontpage obtained for this FutureDiffbotAPIExceptionDiffbotIOExceptionDiffbotParseExceptionDiffbotUnauthorizedException - if the developer token is not recognized or revokedDiffbotServerException - if a HTTP error occurs on the Diffbot serverDiffbotIOException - if an IO error (usually network related) occur during the API callDiffbotAPIException - if an API error occur on Diffbot servers while processing the requestCopyright © 2013. All Rights Reserved.