- Type Parameters:
T- the type of items 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.
Represents a supplier of items.
The supplier can throw Exceptions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> UncheckedSupplier<T> Creates a newUncheckedSupplierfrom an existingSupplierget()Gets an item.
-
Method Details
-
from
Creates a newUncheckedSupplierfrom an existingSupplier- Type Parameters:
T- the type of items supplied by this supplier- Parameters:
supplier- the supplier- Returns:
- the new
UncheckedSupplier
-
get
Gets an item.- Returns:
- an item
- Throws:
Exception- if anything wrong happen
-
toSupplier
- Returns:
- the
Suppliergetting the item produced by thisUncheckedSupplier. If an exception is thrown during the production, this exception is rethrown, wrapped into aRuntimeExceptionif needed.
-