Created
July 28, 2019 00:40
-
-
Save Guilherme-HRamos/a85d6fbc4dc1effe89e3b92fcabf5050 to your computer and use it in GitHub Desktop.
Medium - Android/Java Interfaces like a Boss! - Markers (Facade)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoggerDispatcher implements Logger { | |
private final List<Logger> loggerList = new ArrayList<>(); | |
public LoggerDispatcher(Logger... loggers) { | |
Collections.addAll(loggerList, loggers); | |
} | |
@Override | |
public void logMessage(String message) { | |
for (Logger logger : loggerList) { | |
logger.logMessage(message); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment