private String buildAppleScript(Notification notification) { StringBuilder script = new StringBuilder("display notification "); script.append(DOUBLE_QUOTE) .append(notification.message()) .append(DOUBLE_QUOTE); if (configuration.sound() != null) { script.append(" sound name ") .append(DOUBLE_QUOTE) .append(configuration.sound()) .append(DOUBLE_QUOTE); } script.append(" with title ") .append(DOUBLE_QUOTE) .append(notification.title()) .append(DOUBLE_QUOTE); if (notification.subtitle() != null) { script.append(" subtitle ") .append(DOUBLE_QUOTE) .append(notification.subtitle()) .append(DOUBLE_QUOTE); } return script.toString(); }
private String buildAppleScript(Notification notification) { StringBuilder script = new StringBuilder("display notification "); script.append(DOUBLE_QUOTE) .append(notification.message()) .append(DOUBLE_QUOTE); if (configuration.sound() != null) { script.append(" sound name ") .append(DOUBLE_QUOTE) .append(configuration.sound()) .append(DOUBLE_QUOTE); } script.append(" with title ") .append(DOUBLE_QUOTE) .append(notification.title()) .append(DOUBLE_QUOTE); if (notification.subtitle() != null) { script.append(" subtitle ") .append(DOUBLE_QUOTE) .append(notification.subtitle()) .append(DOUBLE_QUOTE); } return script.toString(); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Notification) { Notification that = (Notification) o; return (this.message.equals(that.message())) && (this.title.equals(that.title())) && ((this.subtitle == null) ? (that.subtitle() == null) : this.subtitle.equals(that.subtitle())) && (this.icon.equals(that.icon())) && (this.level.equals(that.level())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Notification) { Notification that = (Notification) o; return (this.message.equals(that.message())) && (this.title.equals(that.title())) && ((this.subtitle == null) ? (that.subtitle() == null) : this.subtitle.equals(that.subtitle())) && (this.icon.equals(that.icon())) && (this.level.equals(that.level())); } return false; }
private String attachments(Notification notification) { return "[{" + "\"fallback\":\"" + notification.message() + "\"," + "\"color\":\"" + colorize(notification) + "\"," + "\"author_name\":\"" + application.name() + "\"," + "\"title\":\"" + notification.title() + "\"," + "\"text\":\"" + notification.message() + "\n" + notification.subtitle() + "\"," + "}]"; }
private String attachments(Notification notification) { return "[{" + "\"fallback\":\"" + notification.message() + "\"," + "\"color\":\"" + colorize(notification) + "\"," + "\"author_name\":\"" + application.name() + "\"," + "\"title\":\"" + notification.title() + "\"," + "\"text\":\"" + notification.message() + "\n" + notification.subtitle() + "\"," + "}]"; }