Returns a new supplier which is the composition of the provided function and supplier. In other words, the new supplier's value will be computed by retrieving the value from supplier, and then applying function to that value. Note that the resulting supplier will not call {@code supp
(Function<? super F, T> function, Supplier<F> supplier)
| 43 | * call {@code supplier} or invoke {@code function} until it is called. |
| 44 | */ |
| 45 | public static <F, T> Supplier<T> compose(Function<? super F, T> function, Supplier<F> supplier) { |
| 46 | Preconditions.checkNotNull(function); |
| 47 | Preconditions.checkNotNull(supplier); |
| 48 | return new SupplierComposition<F, T>(function, supplier); |
| 49 | } |
| 50 | |
| 51 | private static class SupplierComposition<F, T> implements Supplier<T>, Serializable { |
| 52 | final Function<? super F, T> function; |
no test coverage detected