MCPcopy Index your code
hub / github.com/google/dagger / instancesOf

Method instancesOf

java/dagger/internal/codegen/DaggerStreams.java:75–77  ·  view source on GitHub ↗

Returns a function from Object to Stream , which returns a stream containing its input if its input is an instance of T. Use as an argument to Stream#flatMap(Function): Stream barStream = fooStream.flatMap(instancesOf(Bar.class));

(Class<T> to)

Source from the content-addressed store, hash-verified

73 * <pre>{@code Stream<Bar>} barStream = fooStream.flatMap(instancesOf(Bar.class));</pre>
74 */
75 public static <T> Function<Object, Stream<T>> instancesOf(Class<T> to) {
76 return f -> to.isInstance(f) ? Stream.of(to.cast(f)) : Stream.empty();
77 }
78
79 private DaggerStreams() {}
80}

Callers 6

dependencyEdgesMethod · 0.80
entryPointEdgesMethod · 0.80
bindingNodesStreamMethod · 0.80
componentNodeStreamMethod · 0.80
dependencyEdgeStreamMethod · 0.80
visitBindingMethod · 0.80

Calls 4

isInstanceMethod · 0.80
castMethod · 0.80
ofMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected