Interface CheckedSupplier<T,E extends Exception>

Type Parameters:
T - the type of result supplied by this supplier
E - the type of exception that can be thrown by the get() method
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface CheckedSupplier<T,E extends Exception>
Represents a supplier of results that allows for checked exceptions to be thrown.

This functional interface is similar to java.util.function.Supplier, but it permits its get() method to throw a checked exception. It can be utilized in scenarios where a lambda expression or method reference needs to return a result while also handling exceptions that must be explicitly declared in a method's throws clause.

  • Method Summary

    Modifier and Type
    Method
    Description
    get()
     
  • Method Details