@Beta public final class MapProducer<K,V> extends AbstractProducer<Map<K,V>>
Producer implementation used to implement Map bindings. This producer returns a
Map<K, V> which is populated by calls to the delegate Producer.get() methods.| Modifier and Type | Method and Description |
|---|---|
com.google.common.util.concurrent.ListenableFuture<Map<K,V>> |
compute(ProducerMonitor unusedMonitor)
Computes this producer's future, which is then cached in
AbstractProducer.get(). |
static <K,V> MapProducer<K,V> |
create(Producer<Map<K,Producer<V>>> mapProducerProducer)
Returns a producer of
Map<K, V>, where the map is derived from the given map of
producers by waiting for those producers' resulting futures. |
getpublic static <K,V> MapProducer<K,V> create(Producer<Map<K,Producer<V>>> mapProducerProducer)
Map<K, V>, where the map is derived from the given map of
producers by waiting for those producers' resulting futures. The iteration order mirrors the
order of the input map.
If any of the delegate producers, or their resulting values, are null, then this producer's
future will fail with a NullPointerException.
Canceling this future will attempt to cancel all of the component futures, and if any of the component futures fails or is canceled, this one is, too.
public com.google.common.util.concurrent.ListenableFuture<Map<K,V>> compute(ProducerMonitor unusedMonitor)
AbstractProducerAbstractProducer.get().compute in class AbstractProducer<Map<K,V>>Copyright © 2016 Google, Inc.. All Rights Reserved.