Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Medium - Android/Java Interfaces like a Boss! - Markers (Facade)
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