MCPcopy Create free account
hub / github.com/antlr/codebuff / compose

Method compose

corpus/java/training/guava/base/Suppliers.java:45–49  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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;

Callers 4

keyPredicateOnEntriesMethod · 0.45
retainAllMethod · 0.45
removeAllMethod · 0.45

Calls 1

checkNotNullMethod · 0.95

Tested by

no test coverage detected