public class JsonFuture<T> extends Object implements Future<T>
Future
that, when finished, will need to parse the result of JSON into the
T
object.Copyright © Enremmeta LLC 2015. All Rights Reserved.
Modifier and Type | Field and Description |
---|---|
private Future<String> |
f |
private Class<T> |
type |
Constructor and Description |
---|
JsonFuture(Future<String> f,
Class<T> type) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
protected Class<T> |
getType() |
protected Future<String> |
getUnderlyingFuture() |
boolean |
isCancelled() |
boolean |
isDone() |
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<T>
public T get() throws InterruptedException, ExecutionException
get
in interface Future<T>
InterruptedException
ExecutionException
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<T>
InterruptedException
ExecutionException
TimeoutException