
coffee.CoffeeMaker Maven / Gradle / Ivy
The newest version!
package coffee;
import dagger.Lazy;
import javax.inject.Inject;
class CoffeeMaker {
@Inject Lazy heater; // Don't want to create a possibly costly heater until we need it.
@Inject Pump pump;
public void brew() {
heater.get().on();
pump.pump();
System.out.println(" [_]P coffee! [_]P ");
heater.get().off();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy