zip

abstract fun <U, R> zip(right: Provider<U>, combiner: BiFunction<in T, in U, out @Nullable R>): Provider<R>(source)

Returns a provider which value will be computed by combining this provider value with another provider value using the supplied combiner function.

The resulting provider will be live, so that each time it is queried, it queries both this and the supplied provider and applies the combiner to the results. Whenever any of the providers has no value, the new provider will also have no value and the combiner will not be called.

If the supplied providers represents a task or the output of a task, the resulting provider will carry the dependency information.

Return

a combined provider

Since

6.6

Parameters

right

the second provider to combine with

combiner

the combiner of values. May return null, in which case the provider will have no value.

<U>

the type of the second provider

<R>

the type of the result of the combiner