Interface FailableSupplier<T,E extends Throwable>

Type Parameters:
T - Return type.
E - The kind of thrown exception or error.
All Known Subinterfaces:
ConcurrentInitializer<T>
All Known Implementing Classes:
AbstractConcurrentInitializer, AbstractConcurrentInitializer.AbstractBuilder, AbstractSupplier, AtomicInitializer, AtomicInitializer.Builder, AtomicSafeInitializer, AtomicSafeInitializer.Builder, BackgroundInitializer, BackgroundInitializer.Builder, CallableBackgroundInitializer, ConstantInitializer, LazyInitializer, LazyInitializer.Builder, MultiBackgroundInitializer
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 FailableSupplier<T,E extends Throwable>
A functional interface like Supplier that declares a Throwable.
Since:
3.11
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final FailableSupplier
    Returns the singleton supplier that always returns null.
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Supplies an object
    static <T, E extends Exception>
    FailableSupplier<T,E>
    nul()
    Returns the singleton supplier that always returns null.
  • Field Details

    • NUL

      static final FailableSupplier NUL
      Returns the singleton supplier that always returns null.

      This supplier never throws an exception.

      Since:
      3.14.0
  • Method Details

    • nul

      static <T, E extends Exception> FailableSupplier<T,E> nul()
      Returns the singleton supplier that always returns null.

      This supplier never throws an exception.

      Type Parameters:
      T - Supplied type.
      E - The kind of thrown exception or error.
      Returns:
      The NUL singleton.
      Since:
      3.14.0
    • get

      T get() throws E
      Supplies an object
      Returns:
      a result
      Throws:
      E - if the supplier fails