From f43798b2b09447fadb82b6019029b5e6fa609ba2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 19 Feb 2013 20:47:43 +0100 Subject: [PATCH] Turn static methods into instance methods. --- .../rhynodge/triggers/NewTorrentTrigger.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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"); -- 2.7.4