On this page

UncheckedFuture

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

An Future that throws unchecked instead checked exceptions.

Type parameters:

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

Since:

3.13.0

See also:

Methods

V

get()

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

V

get(long timeout, TimeUnit unit)

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

static <T> Stream<UncheckedFuture<T>>

map(Collection<Future<T>> futures)

Maps the given instances as unchecked.

static <T> Collection<UncheckedFuture<T>>

on(Collection<Future<T>> futures)

Maps the given instances as unchecked.

static <T> UncheckedFuture<T>

on(Future<T> future)

Creates a new instance on the given Future.

V get()[source]

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

The default mapping from checked to unchecked is:

Specified by:

get in interface Future

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:

Specified by:

get in interface Future

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.

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.

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.