Interface Fn0<U>

  • All Superinterfaces:
    java.util.concurrent.Callable<U>, java.util.function.Supplier<U>
    All Known Implementing Classes:
    LazyRef
    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 Fn0<U>
    extends java.util.function.Supplier<U>, java.util.concurrent.Callable<U>
    This is like Java 8's java.util.function.Supplier, but retrofitted to turn checked exceptions into unchecked ones. It's also called a thunk when used to delay evaluation.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default U apply()
      The class that takes a consumer as an argument uses this convenience method so that it doesn't have to worry about checked exceptions either.
      U applyEx()
      Implement this one method and you don't have to worry about checked exceptions.
      default U call()
      default U get()
    • Method Detail

      • applyEx

        U applyEx()
           throws java.lang.Exception
        Implement this one method and you don't have to worry about checked exceptions.
        Throws:
        java.lang.Exception
      • apply

        default U apply()
        The class that takes a consumer as an argument uses this convenience method so that it doesn't have to worry about checked exceptions either.
      • get

        default U get()
        Specified by:
        get in interface java.util.function.Supplier<U>
      • call

        default U call()
                throws java.lang.Exception
        Specified by:
        call in interface java.util.concurrent.Callable<U>
        Throws:
        java.lang.Exception