From: David ‘Bombe’ Roden Date: Tue, 19 Feb 2013 19:47:43 +0000 (+0100) Subject: Turn static methods into instance methods. X-Git-Tag: 0.1~8 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f43798b2b09447fadb82b6019029b5e6fa609ba2;p=rhynodge.git Turn static methods into instance methods. --- diff --git a/src/main/java/net/pterodactylus/rhynodge/triggers/NewTorrentTrigger.java b/src/main/java/net/pterodactylus/rhynodge/triggers/NewTorrentTrigger.java index 12c7f8c..872349e 100644 --- a/src/main/java/net/pterodactylus/rhynodge/triggers/NewTorrentTrigger.java +++ b/src/main/java/net/pterodactylus/rhynodge/triggers/NewTorrentTrigger.java @@ -89,8 +89,8 @@ public class NewTorrentTrigger implements Trigger { @Override public Output output(Reaction reaction) { DefaultOutput output = new DefaultOutput(String.format("Found %d new Torrent(s) for “%s!”", newTorrentFiles.size(), reaction.name())); - output.addText("text/plain", getPlainTextList(newTorrentFiles)); - output.addText("text/html", getHtmlTextList(newTorrentFiles)); + output.addText("text/plain", getPlainTextList(reaction)); + output.addText("text/html", getHtmlTextList(reaction)); return output; } @@ -101,14 +101,14 @@ public class NewTorrentTrigger implements Trigger { /** * Generates a plain text list of torrent files. * - * @param torrentFiles - * The torrent files to list + * @param reaction + * The reaction that was triggered * @return The generated plain text */ - private static String getPlainTextList(List torrentFiles) { + private String getPlainTextList(Reaction reaction) { StringBuilder plainText = new StringBuilder(); plainText.append("New Torrents:\n\n"); - for (TorrentFile torrentFile : torrentFiles) { + for (TorrentFile torrentFile : newTorrentFiles) { plainText.append(torrentFile.name()).append('\n'); plainText.append('\t').append(torrentFile.size()).append(" in ").append(torrentFile.fileCount()).append(" file(s)\n"); plainText.append('\t').append(torrentFile.seedCount()).append(" seed(s), ").append(torrentFile.leechCount()).append(" leecher(s)\n"); @@ -126,11 +126,11 @@ public class NewTorrentTrigger implements Trigger { /** * Generates an HTML list of the given torrent files. * - * @param torrentFiles - * The torrent files to list + * @param reaction + * The reaction that was triggered * @return The generated HTML */ - private static String getHtmlTextList(List torrentFiles) { + private String getHtmlTextList(Reaction reaction) { StringBuilder htmlText = new StringBuilder(); htmlText.append("\n"); htmlText.append("

New Torrents

\n");