UncheckedFuture

public abstract interface org.apache.commons.lang3.concurrent.UncheckedFuture<V> extends Future<V>[source]

An Future that throws unchecked instead checked exceptions.

Parameters:

<V> – The result type returned by this Future’s #get() and #get(long, TimeUnit) methods.

See also:
Since:

3.13.0

Methods

get()

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

get(long, TimeUnit)

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

map(Collection)

Maps the given instances as unchecked.

on(Collection)

Maps the given instances as unchecked.

on(Future)

Creates a new instance on the given Future.

@Override public abstract V get()[source]

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

The default mapping from checked to unchecked is:

@Override public abstract V get(long timeout, TimeUnit unit)[source]

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

The default mapping from checked to unchecked is:

public static <T> Stream<UncheckedFuture<T>> map(Collection<Future<T>> futures)[source]

Maps the given instances as unchecked.

Type parameters:

<T> – The result type returned by the Futures’ #get() and #get(long, TimeUnit) methods.

Parameters:

futures – The Futures to uncheck.

Returns:

A new stream.

public static <T> Collection<UncheckedFuture<T>> on(Collection<Future<T>> futures)[source]

Maps the given instances as unchecked.

Type parameters:

<T> – The result type returned by the Futures’ #get() and #get(long, TimeUnit) methods.

Parameters:

futures – The Futures to uncheck.

Returns:

A new collection.

public static <T> UncheckedFuture<T> on(Future<T> future)[source]

Creates a new instance on the given Future.

Type parameters:

<T> – The result type returned by this Future’s #get() and #get(long, TimeUnit) methods.

Parameters:

future – The Future to uncheck.

Returns:

A new instance.