@Beta public interface Producer<T>
T
. You can also inject
Producer<T>
instead of T
, which will delay the execution of any code that
produces the T
until get()
is called.
For example, you might inject Producer
to lazily choose between several different
implementations of some type:
{@code
com.google.common.util.concurrent.ListenableFuture<T> get()
T
will be submitted to the executor, as their dependencies become available.
If the key is bound to a Produces
method, then calling this method multiple times
will return the same future.
Copyright © 2015 Google, Inc.. All rights reserved.