@Test public void generateTitleAndContent() throws Exception { Pair<String, String> pair = decoratorManager.generateTitleAndContent(alert, true); String title = pair.getKey(); String content = pair.getValue(); logger.info("title: {}", title); logger.info("content: {}",content); }
public Pair<String, String> generateTitleAndContent(AlertEntity alert, boolean isAlertMessage) { Decorator decorator = getDecorator(isAlertMessage); String content = decorator.generateContent(alert); String title = decorator.generateTitle(alert); return new Pair<>(title, content); }
DecoratorManager { public Pair<String, String> generateTitleAndContent(AlertEntity alert, boolean isAlertMessage) { Decorator decorator = getDecorator(isAlertMessage); String content = decorator.generateContent(alert); String title = decorator.generateTitle(alert); return new Pair<>(title, content); } }
DecoratorManager { public Pair<String, String> generateTitleAndContent(AlertEntity alert, boolean isAlertMessage) { Decorator decorator = getDecorator(isAlertMessage); String content = decorator.generateContent(alert); String title = decorator.generateTitle(alert); return new Pair<>(title, content); }  }
DecoratorManager { public Pair<String, String> generateTitleAndContent(AlertEntity alert, boolean isAlertMessage) { Decorator decorator = getDecorator(isAlertMessage); String content = decorator.generateContent(alert); String title = decorator.generateTitle(alert); return new Pair<>(title, content); }  Pair<String, String> generateTitleAndContent(AlertEntity alert, boolean isAlertMessage); Pair<String, String> generateTitleAndContent(Map<ALERT_TYPE, Set<AlertEntity>> alerts, boolean isAlertMessage); }
DecoratorManager { public Pair<String, String> generateTitleAndContent(AlertEntity alert, boolean isAlertMessage) { Decorator decorator = getDecorator(isAlertMessage); String content = decorator.generateContent(alert); String title = decorator.generateTitle(alert); return new Pair<>(title, content); }  Pair<String, String> generateTitleAndContent(AlertEntity alert, boolean isAlertMessage); Pair<String, String> generateTitleAndContent(Map<ALERT_TYPE, Set<AlertEntity>> alerts, boolean isAlertMessage);  }