Interface GSupplierWithException<T>

Type Parameters:
T - 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.

@FunctionalInterface public interface GSupplierWithException<T>
Represents a supplier of results that can throw an exception.
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Gets a result.
    static <T> T
    getOrDefault(GSupplierWithException<T> supplier, T defaultValue)
    Get value from supplier or default if there is an exception.
    static <T> T
    Get value from supplier or null if there is an exception.
  • Method Details

    • get

      T get() throws Exception
      Gets a result.
      Returns:
      A result.
      Throws:
      Exception - Some exception.
    • getOrDefault

      static <T> T getOrDefault(GSupplierWithException<T> supplier, T defaultValue)
      Get value from supplier or default if there is an exception.
      Type Parameters:
      T - Type of value.
      Parameters:
      supplier - Value supplier.
      defaultValue - Default value if there is an exception.
      Returns:
      Value from supplier or default if there is an exception.
    • getOrNull

      static <T> T getOrNull(GSupplierWithException<T> supplier)
      Get value from supplier or null if there is an exception.
      Type Parameters:
      T - Type of value.
      Parameters:
      supplier - Value supplier.
      Returns:
      Value from supplier or null if there is an exception.