April 2018
Intermediate to advanced
246 pages
6h 11m
English
As the name suggests, these are bindings that are automatically covered in the injector. Let the injector make these bindings, as trying to bind them yourself is an error. Loggers is one example of this.
@Singleton public class SMSDatabaseLog implements DatabaseLog { private final Logger logger; @Inject public SMSDatabaseLog(Logger logger) { this.logger = logger; } public void loggerException(UnreachableException e) { //Below message will be logged to the SMSDatabaseLog by logger. logger.warning("SMS Database connection exception, " + e.getMessage()); ...