Top Description Methods
org.apache.commons.lang3.concurrent

public Interface UncheckedFuture<V>

extends Future<V>
Known Direct Implementers
org.apache.commons.lang3.concurrent.UncheckedFutureImpl
Type Parameters
<V>
The result type returned by this Future's get() and get(long, TimeUnit) methods.
Imports
java.util.Collection, java.util.concurrent.ExecutionException, .Future, .TimeUnit, .TimeoutException, java.util.stream.Collectors, .Stream, org.apache.commons.lang3.exception.UncheckedInterruptedException

An Future that throws unchecked instead checked exceptions.
Since
3.13.0
See Also
Future, Exception

Method Summary

Modifier and TypeMethod and Description
public V
get()

Redeclares java.util.concurrent.Future.get.

Gets per Future#get() but rethrows checked exceptions as unchecked.

public V
get(long timeout, TimeUnit unit)

Redeclares java.util.concurrent.Future.get.

Gets per Future#get(long, TimeUnit) but rethrows checked exceptions as unchecked.

public static <
The result type returned by the Futures' get() and get(long, TimeUnit) methods.
T
>
Stream<UncheckedFuture<T>>

Returns:

a new stream.
map
(final Collection<Future<T>>
The Futures to uncheck.
futures
)

Maps the given instances as unchecked.

public static <
The result type returned by the Futures' get() and get(long, TimeUnit) methods.
T
>
Collection<UncheckedFuture<T>>

Returns:

a new collection.
on
(final Collection<Future<T>>
The Futures to uncheck.
futures
)

Maps the given instances as unchecked.

public static <
The result type returned by this Future's get() and get(long, TimeUnit) methods.
T
>
UncheckedFuture<T>

Returns:

a new instance.
on
(final Future<T>
The Future to uncheck.
future
)

Creates a new instance on the given Future.

Inherited from java.util.concurrent.Future:
cancelexceptionNowisCancelledisDoneresultNowstate

Method Detail

getback to summary
public V get()

Redeclares java.util.concurrent.Future.get.

Gets per Future#get() but rethrows checked exceptions as unchecked.

The default mapping from checked to unchecked is:

Annotations
@Override
getback to summary
public V get(long timeout, TimeUnit unit)

Redeclares java.util.concurrent.Future.get.

Gets per Future#get(long, TimeUnit) but rethrows checked exceptions as unchecked.

The default mapping from checked to unchecked is:

Annotations
@Override
mapback to summary
public static <T> Stream<UncheckedFuture<T>> map(final Collection<Future<T>> futures)

Maps the given instances as unchecked.

Parameters
<T>
The result type returned by the Futures' get() and get(long, TimeUnit) methods.
futures:Collection<Future<T>>

The Futures to uncheck.

Returns:Stream<UncheckedFuture<T>>

a new stream.

onback to summary
public static <T> Collection<UncheckedFuture<T>> on(final Collection<Future<T>> futures)

Maps the given instances as unchecked.

Parameters
<T>
The result type returned by the Futures' get() and get(long, TimeUnit) methods.
futures:Collection<Future<T>>

The Futures to uncheck.

Returns:Collection<UncheckedFuture<T>>

a new collection.

onback to summary
public static <T> UncheckedFuture<T> on(final Future<T> future)

Creates a new instance on the given Future.

Parameters
<T>
The result type returned by this Future's get() and get(long, TimeUnit) methods.
future:Future<T>

The Future to uncheck.

Returns:UncheckedFuture<T>

a new instance.