APIdia Launch Partner
Top Description Methods
net.ucanaccess.util

public Interface IThrowingSupplier<R, T extends Throwable>

Annotations
@FunctionalInterface
@SuppressWarnings:java:S1181
Type Parameters
<R>
the type of the result supplied
<T>
the type of Throwable thrown
Imports
java.util.Objects, java.util.function.Function, .Supplier

A supplier of a result of type R which might throw an exception of type T.

This is a functional interface whose functional method is get().

Author
Markus Spann
Since
v5.1.0

Method Summary

Modifier and TypeMethod and Description
public R

Returns:

a result
get
()

Gets a result.

public static <
the type of the result supplied
R
,
the type of Throwable thrown
T extends Throwable
>
IThrowingSupplier<R, T>

Returns:

a throwing supplier
of
(Supplier<R>
a conventional supplier
supplier
)

Creates a IThrowingSupplier from a Supplier.

public default R

Returns:

a value
or
(Function<Throwable, R>
non-null function executed in case of exception. The exception occurred in the supplier is passed to this function
function
)

Returns the supplied value, unless get() threw an exception, in which case the value produced by the supplying function is returned.

public default Supplier<R>

Returns:

supplier
toSupplier
()

Returns a Supplier for this throwing supplier.

Method Detail

getback to summary
public R get() throws IThrowingConsumer:T

Gets a result.

Returns:R

a result

ofback to summary
public static <R, T extends Throwable> IThrowingSupplier<R, T> of(Supplier<R> supplier)

Creates a IThrowingSupplier from a Supplier.

Parameters
<R>
the type of the result supplied
<T>
the type of Throwable thrown
supplier:Supplier<R>

a conventional supplier

Returns:IThrowingSupplier<R, T>

a throwing supplier

orback to summary
public default R or(Function<Throwable, R> function)

Returns the supplied value, unless get() threw an exception, in which case the value produced by the supplying function is returned.

Parameters
function:Function<Throwable, R>

non-null function executed in case of exception. The exception occurred in the supplier is passed to this function

Returns:R

a value

toSupplierback to summary
public default Supplier<R> toSupplier()

Returns a Supplier for this throwing supplier.

Returns:Supplier<R>

supplier

Annotations
@SuppressWarnings:PMD.UseDiamondOperator