Interface Supplier<T>

Type Parameters:
T - the value type returned
All Known Subinterfaces:
ScalarSupplier<T>
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 Supplier<T>
A functional interface (callback) that provides a single value or throws an exception.

This interface was added to allow throwing any subclass of Throwables, which is not directly possible with the Java standard Callable interface.

Since:
3.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Produces a value or throws an exception.
  • Method Details

    • get

      T get() throws Throwable
      Produces a value or throws an exception.
      Returns:
      the value produced
      Throws:
      Throwable - if the implementation wishes to throw any type of exception