Interface CheckedSupplier<T>
- Type Parameters:
T- the type of result supplied by this supplier
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface representing a supplier that can produce a value and may throw a checked exception.
This is a variation of the standard
Supplier interface, intended for use in scenarios where
the operation may involve checked exceptions.
Primary entry point for Try.of(CheckedSupplier) and
Try.withTimeout(java.time.Duration, CheckedSupplier): the supplier is executed and any
thrown exception is captured as a Failure without manual wrapping.
The rationale for providing checked variants of the standard functional interfaces
(and the choice of throws Exception over throws Throwable) is documented in
ADR-019 — CheckedFunction, CheckedSupplier, CheckedRunnable, CheckedConsumer as first-class interfaces.
-
Method Summary
-
Method Details
-
get
-