Class UncheckedFutureImpl<V>
- java.lang.Object
-
- org.apache.commons.lang3.concurrent.AbstractFutureProxy<V>
-
- org.apache.commons.lang3.concurrent.UncheckedFutureImpl<V>
-
- Type Parameters:
V
- The result type returned by this UncheckedFuture'sget()
andget(long, TimeUnit)
methods.
- All Implemented Interfaces:
java.util.concurrent.Future<V>
,UncheckedFuture<V>
class UncheckedFutureImpl<V> extends AbstractFutureProxy<V> implements UncheckedFuture<V>
AnFuture
implementation that throws unchecked instead of checked exceptions.- Since:
- 3.13.0
- See Also:
Future
-
-
Constructor Summary
Constructors Constructor Description UncheckedFutureImpl(java.util.concurrent.Future<V> future)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
get()
Gets perFuture.get()
but rethrows checked exceptions as unchecked.V
get(long timeout, java.util.concurrent.TimeUnit unit)
Gets perFuture.get(long, TimeUnit)
but rethrows checked exceptions as unchecked.-
Methods inherited from class org.apache.commons.lang3.concurrent.AbstractFutureProxy
cancel, getFuture, isCancelled, isDone
-
-
-
-
Constructor Detail
-
UncheckedFutureImpl
UncheckedFutureImpl(java.util.concurrent.Future<V> future)
-
-
Method Detail
-
get
public V get()
Description copied from interface:UncheckedFuture
Gets perFuture.get()
but rethrows checked exceptions as unchecked.The default mapping from checked to unchecked is:
InterruptedException
→UncheckedInterruptedException
ExecutionException
→UncheckedExecutionException
- Specified by:
get
in interfacejava.util.concurrent.Future<V>
- Specified by:
get
in interfaceUncheckedFuture<V>
- Overrides:
get
in classAbstractFutureProxy<V>
-
get
public V get(long timeout, java.util.concurrent.TimeUnit unit)
Description copied from interface:UncheckedFuture
Gets perFuture.get(long, TimeUnit)
but rethrows checked exceptions as unchecked.The default mapping from checked to unchecked is:
InterruptedException
→UncheckedInterruptedException
ExecutionException
→UncheckedExecutionException
TimeoutException
→UncheckedTimeoutException
- Specified by:
get
in interfacejava.util.concurrent.Future<V>
- Specified by:
get
in interfaceUncheckedFuture<V>
- Overrides:
get
in classAbstractFutureProxy<V>
-
-