Package org.organicdesign.fp.function
Interface Fn0<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 Supplier<U>, 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 Exception
Implement this one method and you don't have to worry about checked exceptions.- Throws:
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.
-
-