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)
| 45 | |
| 46 | |
| 47 | public static <F, T> Supplier<T> compose(Function<? super F, T> function, Supplier<F> supplier) { |
| 48 | Preconditions.checkNotNull(function); |
| 49 | Preconditions.checkNotNull(supplier); |
| 50 | return new SupplierComposition<F, T>(function, supplier); |
| 51 | } |
| 52 | |
| 53 | private static class SupplierComposition<F, T> implements Supplier<T>, Serializable { |
| 54 | final Function<? super F, T> function; |
no test coverage detected