🎨 Replace BC watcher with Kotlin version
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 20 Sep 2020 16:39:01 +0000 (18:39 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 20 Sep 2020 16:39:01 +0000 (18:39 +0200)
src/main/java/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.java [deleted file]
src/main/kotlin/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.kt [new file with mode: 0644]

diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.java
deleted file mode 100644 (file)
index 5d21b36..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-package net.pterodactylus.rhynodge.watchers;
-
-import java.util.Arrays;
-
-import net.pterodactylus.rhynodge.Watcher;
-import net.pterodactylus.rhynodge.filters.HtmlFilter;
-import net.pterodactylus.rhynodge.filters.comics.BusinessCatComicFilter;
-import net.pterodactylus.rhynodge.queries.HttpQuery;
-import net.pterodactylus.rhynodge.triggers.NewComicTrigger;
-
-/**
- * {@link Watcher} implementation that watches for new Business Cat comics.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David â€˜Bombe’ Roden</a>
- */
-public class BusinessCatWatcher extends DefaultWatcher {
-
-       public BusinessCatWatcher() {
-               super(new HttpQuery("https://www.businesscatcomic.com/"), Arrays.asList(new HtmlFilter(), new BusinessCatComicFilter()), new NewComicTrigger());
-       }
-
-}
diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.kt b/src/main/kotlin/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.kt
new file mode 100644 (file)
index 0000000..94fe96d
--- /dev/null
@@ -0,0 +1,12 @@
+package net.pterodactylus.rhynodge.watchers
+
+import net.pterodactylus.rhynodge.filters.HtmlFilter
+import net.pterodactylus.rhynodge.filters.comics.BusinessCatComicFilter
+import net.pterodactylus.rhynodge.queries.HttpQuery
+import net.pterodactylus.rhynodge.triggers.NewComicTrigger
+
+class BusinessCatWatcher : DefaultWatcher(query, filters, trigger)
+
+private val query = HttpQuery("https://www.businesscatcomic.com/")
+private val filters = listOf(HtmlFilter(), BusinessCatComicFilter())
+private val trigger = NewComicTrigger()